-
Notifications
You must be signed in to change notification settings - Fork 90
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
JSON RPC interface spec: chainHead_v1 #813
Conversation
Please add tests into this PR |
@ermalkaleci I see that the e2e tests use PolkadotJS to test everything works as expected, but PolkadotJS doesn't use the new RPC-interface Is it alright if I add polkadot-api (or a lower level sub-package) as a devDependency to run the e2e tests for the new rpc spec? |
of course, go ahead |
I've finished adding tests - I had a bit of back-and-forth because I wasn't sure which level should I use for them. One of the issues I had is that the block the tests run with is using a snapshot with a very old version of the metadata (v9 if I'm not wrong), which is not compatible with the higher-level papi libraries (since it relies on metadata v14+ to create the codecs) Settled with |
you could add a new env for papi tests if it helps |
More work for #801
This is the most important group of functions to be implemented from the spec. This makes PAPI already compatible except to send transactions (which needs the
transaction_v1
group of functions).It's not fully spec-compliant, specifically for the
chainHead_v1_storage
call, which has 2 variations that are more complex (closestDescendantMerkleValue
,hash
,descendantsHashes
, and dealing withchildTrie
), but none of those features are used by PAPI. I rather make small incremental PRs, so I would initially focus on having full PAPI compatibility, and later on we can make it full spec compliant.I'd also like to add tests, what do you prefer? Should I raise them as a separate PR or would you like it in this one? I'm thinking on keep raising incremental PRs, first I'll work on the tests for
chainHead_v1
, then implementtransaction_v1
and its tests, and lastlychainSpec_v1
(the last group used by PAPI, but the least important).