Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Metadata V15: Generate Runtime APIs (#918)
* Update frame-metadata to v15.1.0 Signed-off-by: Alexandru Vasile <[email protected]> * Enable V15 unstable metadata in frame-metadata Signed-off-by: Alexandru Vasile <[email protected]> * metadata: Move validation hashing to dedicated file Signed-off-by: Alexandru Vasile <[email protected]> * Use sp-metadata-ir from substrate to work with metadata Signed-off-by: Alexandru Vasile <[email protected]> * Revert using sp-metadata-ir in favor of conversion to v15 Signed-off-by: Alexandru Vasile <[email protected]> * metadata: Convert v14 to v15 Signed-off-by: Alexandru Vasile <[email protected]> * metadata: Use v15 for validation Signed-off-by: Alexandru Vasile <[email protected]> * codegen: Use v15 for codegen Signed-off-by: Alexandru Vasile <[email protected]> * metadata/bench: Use v15 Signed-off-by: Alexandru Vasile <[email protected]> * Adjust to v15 metadata Signed-off-by: Alexandru Vasile <[email protected]> * Adjust testing Signed-off-by: Alexandru Vasile <[email protected]> * Improve documentation Signed-off-by: Alexandru Vasile <[email protected]> * force CI Signed-off-by: Alexandru Vasile <[email protected]> * rpc: Fetch metadata at version Signed-off-by: Alexandru Vasile <[email protected]> * artifacts: Update polkadot.scale from commit 6dc9e84dde2 Signed-off-by: Alexandru Vasile <[email protected]> * codegen: Fetch V15 using the new API Signed-off-by: Alexandru Vasile <[email protected]> * codegen: Add runtime API interface Signed-off-by: Alexandru Vasile <[email protected]> * metadata: Hash runtime API metadata for validation Signed-off-by: Alexandru Vasile <[email protected]> * metadata: Extract runtime API metadata wrapper from subxt::Metadata Signed-off-by: Alexandru Vasile <[email protected]> * subxt: Adjust hashing cache to reflect root+item keys Signed-off-by: Alexandru Vasile <[email protected]> * rpc: Add raw state_call API method Signed-off-by: Alexandru Vasile <[email protected]> * runtime_api: Add payload with static and dynamic variants Signed-off-by: Alexandru Vasile <[email protected]> * subxt: Allow payloads to call into the runtime Signed-off-by: Alexandru Vasile <[email protected]> * examples: Add example to make a runtime API call both static and dynamic Signed-off-by: Alexandru Vasile <[email protected]> * Update polkadot.rs Signed-off-by: Alexandru Vasile <[email protected]> * codegen: Simplify client fetching Signed-off-by: Alexandru Vasile <[email protected]> * Address feedback and fallback to old API if needed Signed-off-by: Alexandru Vasile <[email protected]> * runtime_api: Make mutability conditional on input params Signed-off-by: Alexandru Vasile <[email protected]> * Regenerate polkadot.rs Signed-off-by: Alexandru Vasile <[email protected]> * metadata: Retain only pallets without runtime API info Signed-off-by: Alexandru Vasile <[email protected]> * codegen: Retry via `Metadata_metadata` without conversion Signed-off-by: Alexandru Vasile <[email protected]> * payload: Remove `Decode` and change validation fn Signed-off-by: Alexandru Vasile <[email protected]> * metadata: Retain runtime API types Signed-off-by: Alexandru Vasile <[email protected]> * codegen: Runtime APIs documentation based on flag Signed-off-by: Alexandru Vasile <[email protected]> * Update examples/examples/custom_metadata_url.rs Co-authored-by: James Wilson <[email protected]> * Update artifacts from polkadot-a6cfdb16e9 Signed-off-by: Alexandru Vasile <[email protected]> * Update polkadot.rs with polkadot-a6cfdb16e9 Signed-off-by: Alexandru Vasile <[email protected]> * codegen: Generate input structures for runtime API Signed-off-by: Alexandru Vasile <[email protected]> * runtime_api: Remove the static paylaod and use single impl Signed-off-by: Alexandru Vasile <[email protected]> * examples: Fetch account nonce Signed-off-by: Alexandru Vasile <[email protected]> * testing: Adjust build script to fetch latest metadata Signed-off-by: Alexandru Vasile <[email protected]> * testing: Check account nonce from runtime API Signed-off-by: Alexandru Vasile <[email protected]> * Update cargo.lock Signed-off-by: Alexandru Vasile <[email protected]> * codegen: Fix doc generation for runtime types Signed-off-by: Alexandru Vasile <[email protected]> * codegen: Rename `inputs` runtime calls module to `types` Signed-off-by: Alexandru Vasile <[email protected]> * codegen: Generate Calls structs inside the types module Signed-off-by: Alexandru Vasile <[email protected]> * testing: Check Alice account nonce before submitting the tx Signed-off-by: Alexandru Vasile <[email protected]> * cli: Add metadata version option flag supporting v14 and unstable Signed-off-by: Alexandru Vasile <[email protected]> * cli: Specify version to fetch Signed-off-by: Alexandru Vasile <[email protected]> * subxt: Fallback to fetching latest stable metadata Signed-off-by: Alexandru Vasile <[email protected]> * subxt: Add unstable-metadata feature to fetch the latest Signed-off-by: Alexandru Vasile <[email protected]> * RuntimeVersion with Latest and Version(u32) Signed-off-by: Alexandru Vasile <[email protected]> * Update polkadot.rs Signed-off-by: Alexandru Vasile <[email protected]> * codegen: Adjust fetch_metadata to inspect version list Signed-off-by: Alexandru Vasile <[email protected]> * testing: Adjust metadata to metadata_legacy Signed-off-by: Alexandru Vasile <[email protected]> * events: Adjust docs to use metadata_legacy Signed-off-by: Alexandru Vasile <[email protected]> * have a pass over fetch_metadata * cargo fmt * Option<String> when fetch metadata via latest API * clippy * fmt * cli: Use the MetadataVersion from codegen Signed-off-by: Alexandru Vasile <[email protected]> * cli: Specify latest as default for MetadataVersion Signed-off-by: Alexandru Vasile <[email protected]> * cli: Remove version from metadata and use the one from file_or_url Signed-off-by: Alexandru Vasile <[email protected]> * Fix clippy Signed-off-by: Alexandru Vasile <[email protected]> * codegen: Decode metadata independently for different RPC calls Signed-off-by: Alexandru Vasile <[email protected]> --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: James Wilson <[email protected]>
- Loading branch information