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§
- Extrinsic
Info - Parameters and other information about an individual extrinsic.
- Json
RpcResponse - Helper type when dealing with the Json RPC response returned by
Substrates
state_getMetadata.
Enums§
- Error
- Errors that can occur when parsing Substrate metadata.
- Metadata
Version - Identifier of all the available Substrate metadata versions.
Traits§
- Module
Metadata Ext - 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.