Crate gekko_metadata

Crate gekko_metadata 

Source
Expand description

Utilities to parse and process substrate metadata. Can also be enabled in gekko with the "metadata" feature.

§Example

use gekko_metadata::*;

// Parse runtime metadata
let content = std::fs::read_to_string("metadata_kusama_9080.hex").unwrap();
let data = parse_hex_metadata(content).unwrap().into_inner();

// Get information about the extrinsic.
let extr = data
    .find_module_extrinsic("Balances", "transfer_keep_alive")
    .unwrap();

assert_eq!(extr.module_id, 4);
assert_eq!(extr.dispatch_id, 3);
assert_eq!(
    extr.args,
    vec![
        ("dest", "<T::Lookup as StaticLookup>::Source"),
        ("value", "Compact<T::Balance>"),
    ]
);

Modules§

version
Available versions of Substrates metadata format.

Structs§

ExtrinsicInfo
Parameters and other information about an individual extrinsic.
JsonRpcResponse
Helper type when dealing with the Json RPC response returned by Substrates state_getMetadata.

Enums§

Error
Errors that can occur when parsing Substrate metadata.
MetadataVersion
Identifier of all the available Substrate metadata versions.

Traits§

ModuleMetadataExt
An interface to retrieve information about extrinsics on any Substrate metadata version.

Functions§

parse_hex_metadata
Convenience function for parsing the metadata from a HEX representation, as returned by state_getMetadata.
parse_jsonrpc_metadata
Convenience function for parsing the Json RPC response returned by Substrates state_getMetadata.
parse_raw_metadata
Parse the raw Substrate metadata.