Skip to content

[dot/rpc] implement RPC state_getKeysPaged#1310

Merged
edwardmack merged 14 commits intodevelopmentfrom
ed/implement_state_getKeysPaged
Jan 21, 2021
Merged

[dot/rpc] implement RPC state_getKeysPaged#1310
edwardmack merged 14 commits intodevelopmentfrom
ed/implement_state_getKeysPaged

Conversation

@edwardmack
Copy link
Copy Markdown
Contributor

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

@edwardmack edwardmack self-assigned this Jan 15, 2021
@dutterbutter dutterbutter added this to the Sprint 1 milestone Jan 15, 2021
Comment thread dot/rpc/modules/state.go Outdated
Comment thread dot/state/storage.go Outdated
hash = &sr
}

return s.tries[*hash].GetKeysWithPrefix(prefix), nil
Copy link
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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 <elizabethjbinks@gmail.com>
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