Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/sui-json/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl SuiJsonValue {
// Must be castable to u64
if !n.is_u64() {
return Err(anyhow!(
"{n} not allowed. Number must be unsigned integer of at most u32"
"{n} not allowed. Number must be an unsigned integer"
));
}
}
Expand Down Expand Up @@ -240,7 +240,7 @@ impl SuiJsonValue {
// Bool to Bool is simple
(JsonValue::Bool(b), MoveTypeLayout::Bool) => R::MoveValue::Bool(*b),

// In constructor, we have already checked that the JSON number is unsigned int of at most U32
// In constructor, we have already checked that the JSON number is a non-negative integer (u64)
(JsonValue::Number(n), MoveTypeLayout::U8) => match n.as_u64() {
Some(x) => R::MoveValue::U8(u8::try_from(x)?),
None => return Err(anyhow!("{} is not a valid number. Only u8 allowed.", n)),
Expand Down