Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BLOCK-2560] update on chain values types #253

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,19 @@ The properties of this type are provided below:

`key_value_store` will be an array with first element is type of the value and second is the value. Here is the support list and example:

| Value Type | Key Def Type string | Example |
| ---------- | ------------------- | -------------------------- |
| int8 | int8 | ["int8", 0] |
| int16 | int16 | ["int16", 0] |
| int32 | int32 | ["int32", 0] |
| int64 | int64 | ["int64", 0] |
| uint8 | uint8 | ["uint8", 0] |
| uint16 | uint16 | ["uint16", 0] |
| uint32 | uint32 | ["uint32", 0] |
| uint64 | uint64 | ["uint64", 0] |
| float | float | ["float", 0.1] |
| double | double | ["double", 0.1] |
| string | string | ["string", "a"] |
| INT8_VEC | int8[] | ["INT8_VEC", [0,1,2]] |
| INT16_VEC | int16[] | ["INT16_VEC", [0,1,2]] |
| INT32_VEC | int32[] | ["INT32_VEC", [0,1,2]] |
| INT64_VEC | int64[] | ["INT64_VEC", [0,1,2]] |
| UINT8_VEC | uint8[] | ["UINT8_VEC", [0,1,2]] |
| UINT16_VEC | uint16[] | ["UINT16_VEC", [0,1,2]] |
| UINT32_VEC | uint32[] | ["UINT32_VEC", [0,1,2]] |
| UINT64_VEC | uint64[] | ["UINT64_VEC", [0,1,2]] |
| FLOAT_VEC | float[] | ["FLOAT_VEC", [0.1,1.2]] |
| DOUBLE_VEC | double[] | ["DOUBLE_VEC", [0.1,1.2]] |
| STRING_VEC | string[] | ["STRING_VEC", ["a", "b"]] |
| Value Type | Key Def Type string | Example |
| ---------- | ------------------- | ---------------- |
| int8 | int8 | ["int8", 0] |
| int16 | int16 | ["int16", 0] |
| int32 | int32 | ["int32", 0] |
| int64 | int64 | ["int64", 0] |
| uint8 | uint8 | ["uint8", 0] |
| uint16 | uint16 | ["uint16", 0] |
| uint32 | uint32 | ["uint32", 0] |
| uint64 | uint64 | ["uint64", 0] |
| float | float32 | ["float32", 0.1] |
| double | float64 | ["float64", 0.1] |
| string | string | ["string", "a"] |

### `edit_rights` bitmask breakdown

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,19 @@ Update supported value type for on chain data

Here is the default table of supported value type and its limit.

| C++ Type | Type string | Limit by element |
| ---------- | ----------- | ---------------- |
| int8 | int8 | 1 |
| int16 | int16 | 1 |
| int32 | int32 | 1 |
| int64 | int64 | 1 |
| uint8 | uint8 | 1 |
| uint16 | uint16 | 1 |
| uint32 | uint32 | 1 |
| uint64 | uint64 | 1 |
| float | float | 1 |
| double | double | 1 |
| string | string | 128 |
| INT8_VEC | int8[] | 128 |
| INT16_VEC | int16[] | 64 |
| INT32_VEC | int32[] | 32 |
| INT64_VEC | int64[] | 16 |
| UINT8_VEC | uint8[] | 128 |
| UINT16_VEC | uint16[] | 64 |
| UINT32_VEC | uint32[] | 32 |
| UINT64_VEC | uint64[] | 16 |
| FLOAT_VEC | float[] | 32 |
| DOUBLE_VEC | double[] | 16 |
| STRING_VEC | string[] | 256 |
| C++ Type | Type string | Limit by element |
| -------- | ----------- | ---------------- |
| int8 | int8 | 1 |
| int16 | int16 | 1 |
| int32 | int32 | 1 |
| int64 | int64 | 1 |
| uint8 | uint8 | 1 |
| uint16 | uint16 | 1 |
| uint32 | uint32 | 1 |
| uint64 | uint64 | 1 |
| float | float32 | 1 |
| double | float64 | 1 |
| string | string | 128 |

**Note**: In case of `string` and `string[]`, it will count the total characters instead.

Expand All @@ -61,7 +50,7 @@ The properties of this type are provided below:
## CLI - cleos

```bash
cleos push action eosio.nft.ft setktypes '{ "key_types": [ {"key_type": "int8", "element_number_limit": 1}, {"key_type": "int16", "element_number_limit": 1}, {"key_type": "int32", "element_number_limit": 1}, {"key_type": "int64", "element_number_limit": 1}, {"key_type": "uint8", "element_number_limit": 1}, {"key_type": "uint16", "element_number_limit": 1}, {"key_type": "uint32", "element_number_limit": 1}, {"key_type": "uint64", "element_number_limit": 1}, {"key_type": "float", "element_number_limit": 1}, {"key_type": "double", "element_number_limit": 1}, {"key_type": "string", "element_number_limit": 128}, {"key_type": "int8[]", "element_number_limit": 128}, {"key_type": "int16[]", "element_number_limit": 64}, {"key_type": "int32[]", "element_number_limit": 32}, {"key_type": "int64[]", "element_number_limit": 16}, {"key_type": "uint8[]", "element_number_limit": 128}, {"key_type": "uint16[]", "element_number_limit": 64}, {"key_type": "uint32[]", "element_number_limit": 32}, {"key_type": "uint64[]", "element_number_limit": 16}, {"key_type": "float[]", "element_number_limit": 32}, {"key_type": "double[]", "element_number_limit": 16}, {"key_type": "string[]", "element_number_limit": 256} ] }' -p ultra.nft.ft@active
cleos push action eosio.nft.ft setktypes '{ "key_types": [ {"key_type": "int8", "element_number_limit": 1}, {"key_type": "int16", "element_number_limit": 1}, {"key_type": "int32", "element_number_limit": 1}, {"key_type": "int64", "element_number_limit": 1}, {"key_type": "uint8", "element_number_limit": 1}, {"key_type": "uint16", "element_number_limit": 1}, {"key_type": "uint32", "element_number_limit": 1}, {"key_type": "uint64", "element_number_limit": 1}, {"key_type": "float32", "element_number_limit": 1}, {"key_type": "float64", "element_number_limit": 1}, {"key_type": "string", "element_number_limit": 128} ] }' -p ultra.nft.ft@active
```

## JavaScript - eosjs
Expand All @@ -83,20 +72,9 @@ await transact(
{key_type: "uint16", element_number_limit: 1},
{key_type: "uint32", element_number_limit: 1},
{key_type: "uint64", element_number_limit: 1},
{key_type: "float", element_number_limit: 1},
{key_type: "double", element_number_limit: 1},
{key_type: "string", element_number_limit: 128},
{key_type: "int8[]", element_number_limit: 128},
{key_type: "int16[]", element_number_limit: 64},
{key_type: "int32[]", element_number_limit: 32},
{key_type: "int64[]", element_number_limit: 16},
{key_type: "uint8[]", element_number_limit: 128},
{key_type: "uint16[]", element_number_limit: 64},
{key_type: "uint32[]", element_number_limit: 32},
{key_type: "uint64[]", element_number_limit: 16},
{key_type: "float[]", element_number_limit: 32},
{key_type: "double[]", element_number_limit: 16},
{key_type: "string[]", element_number_limit: 256}
{key_type: "float32", element_number_limit: 1},
{key_type: "float64", element_number_limit: 1},
{key_type: "string", element_number_limit: 128}
]
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,19 @@ The properties of this type are provided below:

`key_value_store` will be an array with first element is type of the value and second is the value. Here is the support list and example:

| Value Type | Key Def Type string | Example |
| ---------- | ------------------- | -------------------------- |
| int8 | int8 | ["int8", 0] |
| int16 | int16 | ["int16", 0] |
| int32 | int32 | ["int32", 0] |
| int64 | int64 | ["int64", 0] |
| uint8 | uint8 | ["uint8", 0] |
| uint16 | uint16 | ["uint16", 0] |
| uint32 | uint32 | ["uint32", 0] |
| uint64 | uint64 | ["uint64", 0] |
| float | float | ["float", 0.1] |
| double | double | ["double", 0.1] |
| string | string | ["string", "a"] |
| INT8_VEC | int8[] | ["INT8_VEC", [0,1,2]] |
| INT16_VEC | int16[] | ["INT16_VEC", [0,1,2]] |
| INT32_VEC | int32[] | ["INT32_VEC", [0,1,2]] |
| INT64_VEC | int64[] | ["INT64_VEC", [0,1,2]] |
| UINT8_VEC | uint8[] | ["UINT8_VEC", [0,1,2]] |
| UINT16_VEC | uint16[] | ["UINT16_VEC", [0,1,2]] |
| UINT32_VEC | uint32[] | ["UINT32_VEC", [0,1,2]] |
| UINT64_VEC | uint64[] | ["UINT64_VEC", [0,1,2]] |
| FLOAT_VEC | float[] | ["FLOAT_VEC", [0.1,1.2]] |
| DOUBLE_VEC | double[] | ["DOUBLE_VEC", [0.1,1.2]] |
| STRING_VEC | string[] | ["STRING_VEC", ["a", "b"]] |
| Value Type | Key Def Type string | Example |
| ---------- | ------------------- | ---------------- |
| int8 | int8 | ["int8", 0] |
| int16 | int16 | ["int16", 0] |
| int32 | int32 | ["int32", 0] |
| int64 | int64 | ["int64", 0] |
| uint8 | uint8 | ["uint8", 0] |
| uint16 | uint16 | ["uint16", 0] |
| uint32 | uint32 | ["uint32", 0] |
| uint64 | uint64 | ["uint64", 0] |
| float | float32 | ["float32", 0.1] |
| double | float64 | ["float64", 0.1] |
| string | string | ["string", "a"] |

## CLI - cleos

Expand Down
Loading