[dot/state] implement state_subscribeStorage#1290
Merged
edwardmack merged 27 commits intodevelopmentfrom Jan 12, 2021
Merged
Conversation
Added test for encoding balances genesis parameters.
RyRy79261
approved these changes
Jan 12, 2021
github-actions bot
pushed a commit
that referenced
this pull request
Jan 12, 2021
Edward Mack: [dot/state] implement state_subscribeStorage (#1290) * added system accounts to gensis configs Added test for encoding balances genesis parameters. * add to full account object to raw genesis * fix tests * enable rpc module by defualt * update gssmr genesis to use palletBalances key * update genesis-raw * use subscribe for db listener * testing db storage subscribe * lint * add test for db subscribe * add Example db.Subscribe code * update go.mod to use updated chaindb * implement subscribe storage, move filters * remove unused code * lint * remove redundant test * modify tests to increase coverage
noot
reviewed
Jan 12, 2021
Comment on lines
+177
to
+188
| ent := s.tries[root].Entries() | ||
| for k, v := range ent { | ||
| if k != ":code" { | ||
| // todo, currently we're ignoring :code since this is a lot of data | ||
| kv := &KeyValue{ | ||
| Key: common.MustHexToBytes(fmt.Sprintf("0x%x", k)), | ||
| Value: v, | ||
| } | ||
| subRes.Changes = append(subRes.Changes, *kv) | ||
| } | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
this seems to send all the entries in the trie, not just the ones that are changed? am I mistaken?
Contributor
Author
There was a problem hiding this comment.
Right, I wasn't sure about this, however when I was testing with Substrate node, using key 0x26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850 (System EventCount) I saw that it was responding with a value every block, even though the value remained the same (1). So I figured that I should replicate the same behavior.
This was referenced Oct 19, 2022
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
Tests
Make websocket call:
and enjoy the results.
Checklist
Issues