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

[dot/rpc] implement RPC state_getKeysPaged #1310

Merged
merged 14 commits into from
Jan 21, 2021

Conversation

edwardmack
Copy link
Member

Changes

Tests

go test ./dot/rpc/...

Checklist

  • I have read CODE_OF_CONDUCT and CONTRIBUTING
  • I have provided as much information as possible and necessary
  • I have reviewed my own pull request before requesting a review
  • All integration tests and required coverage checks are passing

Issues

dot/rpc/modules/state.go Outdated Show resolved Hide resolved
hash = &sr
}

return s.tries[*hash].GetKeysWithPrefix(prefix), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

can you error or load trie from database in the case s.tries[*hash] is nil?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, good catch. All set.

Copy link
Contributor

@noot noot left a comment

Choose a reason for hiding this comment

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

great work!

@edwardmack edwardmack merged commit 1d3b2ed into development Jan 21, 2021
@edwardmack edwardmack deleted the ed/implement_state_getKeysPaged branch January 21, 2021 15:09
github-actions bot pushed a commit that referenced this pull request Jan 21, 2021
Edward Mack: [dot/rpc] implement RPC state_getKeysPaged (#1310)

* implement getKeysPaged RPC and storage functions

* add tests for state_getKeysPaged

* use GetKeysWithPrefix for RPC call

* fix GetKeysWithPrefix

* add go.sum

* add check if trie is nil

Co-authored-by: noot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement RPC state_getKeysPaged
4 participants