-
Notifications
You must be signed in to change notification settings - Fork 242
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
Add chainHead
RPC methods
#766
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
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.
This looks great to me offhand!
One thing I'd suggest I think is to add a few integration tests to call these methods and ensure that they actually work: given that they may be around a while until we are fully using them, it'd be good to ensure that they keep working incase anything changes in the (unstable) API in the meantime :)
Co-authored-by: James Wilson <james@jsdw.me>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
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.
Love the tests too; great work!
/// When the user is no longer interested in a block, the user is responsible | ||
/// for calling the [`chainhead_unstable_unpin`](Rpc::chainhead_unstable_unpin) method on each. | ||
/// Failure to do so will result in the subscription being dropped by the chain. | ||
pub async fn chainhead_unstable_follow( |
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.
could be nice to have a separate module or something for the v2 impls but perhaps _unstable
is sufficient
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.
In the longer run, hopefully we will be able to remove all of the "old" methods and only have these new ones on this Rpc type :)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This PR adds support for the low level
chainHead
interface exposed by the substrate nodes.The
chianHead
family of functions is added to subxt's RPC methods, together with the corresponding events required for interpreting the data of the RPC methods.This PR takes the essential parts of #762 PR to aim towards a mergeable form.
Part of #732.