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§

  • Available versions of Substrates metadata format.

Structs§

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

Enums§

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

Traits§

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

Functions§

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