Module helpers

Module helpers 

Source
Expand description

Helper functions and types to assist with decoding.

  • type_registry_from_metadata is expected to be used when decoding things from historic runtimes, adding the ability to decode some types from information in the metadata.
  • decode_with_error_tracing is like decode_with_visitor, but will use a tracing visitor (if the error-tracing feature is enabled) to provide more information in the event that decoding fails.
  • list_storage_entries returns an iterator over all of the storage entries available in some metadata.

Re-exports§

pub use scale_decode;

Structs§

DecodeErrorTrace
A tracing decode error.
StorageEntry
Details about a single storage entry.

Functions§

decode_with_error_tracing
Decode some bytes given a type ID and type resolver, and a visitor which decides the output value.
decode_with_visitor
An alias to scale_decode::visitor::decode_with_visitor. This can be used to decode the byte ranges given back from functions like crate::extrinsics::decode_extrinsic_current or crate::storage::decode_storage_key_current.
list_storage_entries
Returns an iterator listing the available storage entries in some metadata.
list_storage_entries_any
Returns an iterator listing the available storage entries in some metadata.
type_registry_from_metadata
frame_metadata::RuntimeMetadata contains information about runtime calls and events. This function adds this information into a scale_info_legacy::TypeRegistry which can then be referenced by other types. The main types you’ll be able to reference from this set are:
type_registry_from_metadata_any
This is like type_registry_from_metadata, except it can be handed the outer frame_metadata::RuntimeMetadata enum and will extract types from it where appropriate (handing back no types for deprecated or modern metadata).