This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Description
Fixed get_kv_table_rows bugs:
-Made upper_bound optional when reverse option is not set
-Made lower_bound optional when reverse option is set
-Fixed when upper_bound value is not found, the iterator points to end value
-Changed --index can return multiple rows
-Changed next_key format to hex string so that the next call can be called easily using "--encode-type bytes"
-Replaced -k option with -i and --index in order to be in sync with get_table_rows
Change Type
Select ONE
Consensus Changes
API Changes
cleos
-k option removed
-i, --input added.
Positionals:
account TEXT REQUIRED The account who owns the table
table TEXT REQUIRED The name of the kv_table as specified by the contract abi
index_name TEXT REQUIRED The name of the kv_table index as specified by the contract abi
Options:
-h,--help Print this help message and exit
-l,--limit UINT The maximum number of rows to return
-i,--index TEXT Index value
-L,--lower TEXT JSON representation of lower bound value of key, defaults to first
-U,--upper TEXT JSON representation of upper bound value of key, defaults to last
--encode-type TEXT The encoding type of index_value, lower bound, upper bound 'bytes' for hexdecimal encoded bytes 'string' for string value 'dec' for decimal encoding of (uint[64|32|16|8], int[64|32|16|8], float64) 'hex' for hexdecimal encoding of (uint[64|32|16|8], int[64|32|16|8], sha256, ripemd160
-b,--binary Return the value as BINARY rather than using abi to interpret as JSON
-r,--reverse Iterate in reverse order
--show-payer Show RAM payer
Documentation Additions
When --reverse option is not set, --upper is optional, If --upper is not set, the result includes the end of the matching rows.
When --reverse option is set , --lower is optional, if --lower is not set, the result includes the begning of the matchin rows.
-k is replaced by -i/--input option to be in sync. with get_table_rows() call
When result has more = true and next_key is set, the following call to get_kv_table_rows should set --encode-type bytes and
set the next_key value to index or lower/upper value.
When --index is used to search non unique secondary index, result can return multiple rows.