dot/rpc: implement RPC state storage calls#835
Merged
edwardmack merged 15 commits intodevelopmentfrom May 6, 2020
Merged
Conversation
noot
reviewed
May 2, 2020
Comment on lines
+140
to
+148
| resI, err := sm.storageAPI.GetStorage(reqBytes) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| if resI != nil { | ||
| *res = append(*res, []string{"0x" + hex.EncodeToString(reqBytes), "0x" + hex.EncodeToString(resI)}) | ||
| } else { | ||
| *res = []interface{}{} | ||
| } |
Contributor
There was a problem hiding this comment.
I think this only gets one value from a key, but it should get all keys with the the same prefix? this functionality will need to be implemented into the trie since it doesn't exist yet, I can make an issue for it
noot
reviewed
May 2, 2020
|
|
||
| // GetStorageHash isn't implemented properly yet. | ||
| func (sm *StateModule) GetStorageHash(r *http.Request, req *StateStorageQueryRequest, res *StateStorageHashResponse) { | ||
| func (sm *StateModule) GetStorageHash(r *http.Request, req *[]string, res *interface{}) error { |
Contributor
There was a problem hiding this comment.
cool, could you add a TODO for this saying it can be finished when we have the storage changes trie?
noot
reviewed
May 2, 2020
|
|
||
| // GetStorageSize isn't implemented properly yet. | ||
| func (sm *StateModule) GetStorageSize(r *http.Request, req *StateStorageQueryRequest, res *StateStorageSizeResponse) { | ||
| func (sm *StateModule) GetStorageSize(r *http.Request, req *[]string, res *interface{}) error { |
thomasmodeneis
approved these changes
May 4, 2020
noot
approved these changes
May 6, 2020
Contributor
noot
left a comment
There was a problem hiding this comment.
please add TODOs, otherwise looks good!
ryanchristo
pushed a commit
that referenced
this pull request
Jun 24, 2020
* rpc getStorage * implement basic rpc state_getStorage call * added test for state_getStorage * implement state_getPairs * implement state_getStorageHash * implement state_getStorageSize * refactor tests * cleanup comments * added tests * updated comments * added TODOs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
Implement RPC calls for state storage functions.
Tests:
Checklist:
Issues: