Skip to content

Commit

Permalink
Change ObjectID to 20 byte (#7382)
Browse files Browse the repository at this point in the history
  • Loading branch information
randall-Mysten authored Jan 13, 2023
1 parent 01efa8b commit 3915752
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/src/reference/sui-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Additionally, Move supports U128 and U256 but JSON doesn't. As a result we allow
| U128 | Two formats are supported<ul><li>Decimal string with value &lt; U128::MAX.</li><li>Up to 16 byte hex string prefixed with `0x`.</li></ul> | `"74794734937420002470"`<br>`"0x2B1A39A1514E1D8A7CE"` | `34`: Although this is a valid U128 number, it must be encoded as a string |
| U256 | Two formats are supported<ul><li>Decimal string with value &lt; U256::MAX.</li><li>Up to 32 byte hex string prefixed with `0x`.</li></ul> | `"747947349374200024707479473493742000247"`<br>`"0x2B1762FECADA39753FCAB2A1514E1D8A7CE"` | `123434`: Although this is a valid U256 number, it must be encoded as a string |
| Address | 20 byte hex string prefixed with `0x` | `"0x2B1A39A1514E1D8A7CE45919CFEB4FEE70B4E011"` | `0x2B1A39`: string too short<br>`2B1A39A1514E1D8A7CE45919CFEB4FEE70B4E011`: missing `0x` prefix<br>`0xG2B1A39A1514E1D8A7CE45919CFEB4FEE70B4E01`: invalid hex char `G` |
| ObjectID | 16 byte hex string prefixed with `0x` | `"0x2B1A39A1514E1D8A7CE45919CFEB4FEE"` | Similar to above |
| ObjectID | 20 byte hex string prefixed with `0x` | `"0x2B1A39A1514E1D8A7CE45919CFEB4FEE70B4E011"` | Similar to above |
| Identifier | Typically used for module and function names. Encoded as one of the following:<ol><li>A String whose first character is a letter and the remaining characters are letters, digits or underscore.</li><li>A String whose first character is an underscore, and there is at least one further letter, digit or underscore</li></ol> | `"function"`,<br>`"_function"`,<br>`"some_name"`,<br>`"\___\_some_name"`,<br>`"Another"` | `"_"`: missing trailing underscore, digit or letter,<br>`"8name"`: cannot start with digit,<br>`".function"`: cannot start with period,<br>`" "`: cannot be empty space,<br>`"func name"`: cannot have spaces |
| Vector&lt;Move Type> | Homogeneous vector of aforementioned types including nested vectors of primitive types (only "flat" vectors of ObjectIDs are allowed) | `[1,2,3,4]`: simple U8 vector<br>`[[3,600],[],[0,7,4]]`: nested U32 vector `["0x2B1A39A1514E1D8A7CE45919CFEB4FEE", "0x2B1A39A1514E1D8A7CE45919CFEB4FEF"]`: ObjectID vector | `[1,2,3,false]`: not homogeneous JSON<br>`[1,2,null,4]`: invalid elements<br>`[1,2,"7"]`: although we allow encoding numbers as strings meaning this array can evaluate to `[1,2,7]`, the array is still ambiguous so it fails the homogeneity check. |
| Vector&lt;U8> | <em>For convenience, we allow:</em><br>U8 vectors represented as UTF-8 (and ASCII) strings. | `"√®ˆbo72 √∂†∆˚–œ∑π2ie"`: UTF-8<br>`"abcdE738-2 _=?"`: ASCII | |
Expand Down

1 comment on commit 3915752

@vercel
Copy link

@vercel vercel bot commented on 3915752 Jan 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.