This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
state_getMetaData does not return all the available extrinsics & storage entries #753
Copy link
Copy link
Closed
Description
With this morning's Polkadot master running with --dev, the following output is received -
$ curl -H "Content-Type: Application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "state_getMetadata"}' http://localhost:9933
{"jsonrpc":"2.0","result":{"events":{"events":{"balances":{"NewAccount":{"description":[" A new account was created."],"params":["AccountId","AccountIndex","NewAccountOutcome"]},"ReapedAccount":{"description":[" An account was reaped."],"params":["AccountId"]},"Transfer":{"description":[" Transfer succeeded (from, to, value, fees)."],"params":["AccountId","AccountId","Balance","Balance"]}},"council":{"BadReaperSlashed":{"description":[" slashed reaper"],"params":["AccountId"]},"TallyFinalised":{"description":[" A tally (for approval votes of council seat(s)) has ended (with one or more new members)."],"params":["Vec<AccountId>","Vec<AccountId>"]},"TallyStarted":{"description":[" A tally (for approval votes of council seat(s)) has started."],"params":["u32"]},"VoterReaped":{"description":[" reaped voter, reaper"],"params":["AccountId","AccountId"]}},"council_motions":{"Approved":{"description":[" A motion was approved by the required threshold."],"params":["Hash"]},"Disapproved":{"description":[" A motion was not approved by the required threshold."],"params":["Hash"]},"Executed":{"description":[" A motion was executed; `bool` is true if returned without error."],"params":["Hash","bool"]},"Proposed":{"description":[" A motion (given hash) has been proposed (by given account) with a threshold (given u32)."],"params":["AccountId","ProposalIndex","Hash","u32"]},"Voted":{"description":[" A motion (given hash) has been voted on by given account, leaving"," a tally (yes votes and no votes given as u32s respectively)."],"params":["AccountId","Hash","bool","u32","u32"]}},"council_voting":{"TallyCancelation":{"description":[" A voting tally has happened for a referendum cancelation vote."," Last three are yes, no, abstain counts."],"params":["Hash","u32","u32","u32"]},"TallyReferendum":{"description":[" A voting tally has happened for a referendum vote."," Last three are yes, no, abstain counts."],"params":["Hash","u32","u32","u32"]}},"democracy":{"Cancelled":{"description":[],"params":["ReferendumIndex"]},"Executed":{"description":[],"params":["ReferendumIndex","bool"]},"NotPassed":{"description":[],"params":["ReferendumIndex"]},"Passed":{"description":[],"params":["ReferendumIndex"]},"Started":{"description":[],"params":["ReferendumIndex","VoteThreshold"]},"Tabled":{"description":[],"params":["PropIndex","Balance","Vec<AccountId>"]}},"session":{"NewSession":{"description":[" New session has happened. Note that the argument is the session index, not the block"," number as the type might suggest."],"params":["BlockNumber"]}},"staking":{"OfflineSlash":{"description":[" One validator (and their nominators) has been slashed by the given amount."],"params":["AccountId","Balance"]},"OfflineWarning":{"description":[" One validator (and their nominators) has been given a offline-warning (they're still"," within their grace). The accrued number of slashes is recorded, too."],"params":["AccountId","u32"]},"Reward":{"description":[" All validators have been rewarded by the given balance."],"params":["Balance"]}},"system":{"ExtrinsicFailed":{"description":[" An extrinsic failed."],"params":null},"ExtrinsicSuccess":{"description":[" An extrinsic completed successfully."],"params":null}},"treasury":{"Awarded":{"description":[" Some funds have been allocated."],"params":["ProposalIndex","Balance","AccountId"]},"Burnt":{"description":[" Some of our funds have been burnt."],"params":["Balance"]},"Proposed":{"description":[" New proposal."],"params":["ProposalIndex"]},"Rollover":{"description":[" Spending has finished; this is the amount that rolls over until next spend."],"params":["Balance"]},"Spending":{"description":[" We have ended a spend period and will now allocate funds."],"params":["Balance"]}}},"name":"Event"},"moduleWithStorage":{"module":{"call":{"functions":{"0":{"description":[" Provide candidate receipts for parachains, in ascending order by id."],"name":"set_heads","params":[{"name":"origin","type":"T::Origin"},{"name":"heads","type":"Vec<CandidateReceipt>"}]},"0 + 1":{"description":[],"name":"register_parachain","params":[{"name":"origin","type":"T::Origin"},{"name":"id","type":"Id"},{"name":"code","type":"Vec<u8>"},{"name":"initial_head_data","type":"Vec<u8>"}]},"0 + 1 + 1":{"description":[],"name":"deregister_parachain","params":[{"name":"origin","type":"T::Origin"},{"name":"id","type":"Id"}]}},"name":"Call"},"name":"Module"},"prefix":"parachains","storage":{"items":{"Code":{"description":[],"modifier":null,"type":{"key":"Id","value":"Vec<u8>"}},"DidUpdate":{"description":[],"modifier":"default","type":"bool"},"Heads":{"description":[],"modifier":null,"type":{"key":"Id","value":"Vec<u8>"}},"Parachains":{"description":[],"modifier":"default","type":"Vec<Id>"}},"prefix":"Parachains"}}},"id":1}
Some omissions -
- Only parachains are included as a result, i.e. we are missing council, democracy, timestamp, system, balances, ... (Effectively nothing from the substrate base is included, not storage and neither the public and private calls)
2. Storage entries are missing the actual prefixes, without these the API user cannot construct the correct storage keys for queries (in the case of parachain, e.g. [EDIT: This is now invalid, the crate name + entry name is used to generate the prefix]para:code for code, ...)
3. Not 100% convinced on the [This should be fixed now - gav]0, 0 + 1, 0 + 1 + 1 for what I'm assuming to be indexes. However could live with it once I figure out how to interpret them.
Metadata
Metadata
Assignees
Labels
No labels