Skip to content
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 ledger_getEvents to sov_ledger_rpc::RpcClient #1037

Closed
neysofu opened this issue Oct 16, 2023 · 1 comment · Fixed by #1067
Closed

Add ledger_getEvents to sov_ledger_rpc::RpcClient #1037

neysofu opened this issue Oct 16, 2023 · 1 comment · Fixed by #1067
Labels
enhancement New feature or request

Comments

@neysofu
Copy link
Member

neysofu commented Oct 16, 2023

PR #1032 introduced a jsonrpsee client for the ledger RPC API, but it's missing ledger_getEvents. Unfortunately, jsonrpsee's rpc macro is not flexible enough to allow for the kind of parameter serialization logic that we need for this method. All we need is a Vec<EventIdentifier> e.g. "params": [1, 2, 42], but jsonrpsee serializes the event_ids as "params": [[1, 2, 42]].

The solution seems to be replacing the rpc macro -generated trait RpcClient and replacing it with a hand-written one, which correctly serializes all parameter types.

@neysofu neysofu added the enhancement New feature or request label Oct 16, 2023
@neysofu
Copy link
Member Author

neysofu commented Oct 18, 2023

Related: #1066.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant