-
Notifications
You must be signed in to change notification settings - Fork 110
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
feat(dot/rpc) implement chain_subscribeAllHeads
RPC
#1740
feat(dot/rpc) implement chain_subscribeAllHeads
RPC
#1740
Conversation
dot/rpc/subscription/listeners.go
Outdated
continue | ||
} | ||
|
||
res := newSubcriptionBaseResponseJSON() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change this constructor to just take Method
and Params
. Seems odd that we need to populate it ourselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
dot/rpc/subscription/websocket.go
Outdated
listener := new(AllBlocksListener) | ||
listener.cancel = make(chan struct{}) | ||
listener.done = make(chan struct{}) | ||
listener.cancelTimeout = defaultCancelTimeout | ||
listener.wsconn = c | ||
listener.finalizedChan = make(chan *types.FinalisationInfo, DEFAULT_BUFFER_SIZE) | ||
listener.importedChan = make(chan *types.Block, DEFAULT_BUFFER_SIZE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to constructor newAllBlocksListener
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Codecov Report
@@ Coverage Diff @@
## development #1740 +/- ##
===============================================
+ Coverage 59.08% 59.10% +0.02%
===============================================
Files 184 184
Lines 19336 19396 +60
===============================================
+ Hits 11424 11464 +40
- Misses 5931 5945 +14
- Partials 1981 1987 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
🎉 This PR is included in version 0.6.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
* feat: implement chain subscribe all heads * chore: add unit tests to subscribe all heads * chore: fix lint * chore: create constructor * chore: improve AllBlocksListener export comment Co-authored-by: noot <36753753+noot@users.noreply.github.com> Co-authored-by: noot <36753753+noot@users.noreply.github.com>
Changes
chain_subscribeAllHeads
andchain_unsubscribeAllHeads
BlockAPI
and notify the websocket every new block or finalizationTests
Issues
chain_subscribeAllHeads
rpc method #1741Primary Reviewer