Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

refactor get_kv_table_rows #9964

Merged
merged 8 commits into from
Feb 2, 2021

Conversation

huangminghuang
Copy link
Contributor

@huangminghuang huangminghuang commented Jan 27, 2021

Change Description

This PR refactors read_only::get_kv_table_rows and fixes the following problems

  • prevent combining --lower/--upper with --index
  • assert if upper value is less than lower value
  • don't treat empty string the same as not present for lower_bound, upper_bound, or index_value
  • support default encode type for get_kv_table_rows
  • implement show payer option

Change Type

Select ONE:

  • Documentation
  • Stability bug fix
  • Other
  • Other - special case

Testing Changes

Select ANY that apply:

  • New Tests
  • Existing Tests
  • Test Framework
  • CI System
  • Other

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

@huangminghuang huangminghuang force-pushed the huangminghuang/refactor-kv-get-rows branch from 7b8637e to 654a10a Compare January 28, 2021 22:12
tests/get_kv_table_nodeos_tests.cpp Show resolved Hide resolved
plugins/chain_plugin/chain_plugin.cpp Outdated Show resolved Hide resolved
plugins/chain_plugin/chain_plugin.cpp Outdated Show resolved Hide resolved
plugins/chain_plugin/chain_plugin.cpp Outdated Show resolved Hide resolved
fc::variant get_value_and_maybe_payer_var(fc::time_point cur_time) const {
fc::variant result = get_value_var(cur_time);
if (context.p.show_payer) {
auto maybe_payer = base->kv_it_payer();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should just assume payer is there, or else we should assert, since the only reason kv_it_payer doesn't return a payer is if kv_it_value wasn't called first.

plugins/chain_plugin/chain_plugin.cpp Show resolved Hide resolved
@huangminghuang huangminghuang force-pushed the huangminghuang/refactor-kv-get-rows branch from df5cd47 to 0b0bd24 Compare February 2, 2021 16:13
@huangminghuang huangminghuang merged commit 19c900e into develop Feb 2, 2021
@huangminghuang huangminghuang deleted the huangminghuang/refactor-kv-get-rows branch May 14, 2021 13:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants