Skip to main content

Module utils

Module utils 

Source
Expand description

Miscellaneous utility helpers.

Modules§

bits
Generic scale_bits over bitvec-like BitOrder and BitFormat types.
eth
A couple of convenience types to use for Ethereum style chains.

Structs§

AccountId32
A 32-byte cryptographic identifier. This is a simplified version of Substrate’s sp_core::crypto::AccountId32. To obtain more functionality, convert this into that type.
Encoded
Wraps an already encoded byte vector, prevents being encoded as a raw byte vector as part of the transaction payload
H160
Fixed-size uninterpreted hash type with 20 bytes (160 bits) size.
H256
Fixed-size uninterpreted hash type with 32 bytes (256 bits) size.
H512
Fixed-size uninterpreted hash type with 64 bytes (512 bits) size.
RangeMap
A map that associates ranges of keys with values.
RangeMapBuilder
A builder for constructing a RangeMap. Use ``RangeMap::builder()` to create one.
Static
If the type inside this implements Encode, this will implement scale_encode::EncodeAsType. If the type inside this implements Decode, this will implement scale_decode::DecodeAsType.
UncheckedExtrinsic
The unchecked extrinsic from substrate.
WrapperKeepOpaque
A wrapper for any type T which implement encode/decode in a way compatible with Vec<u8>. WrapperKeepOpaque stores the type only in its opaque format, aka as a Vec<u8>. To access the real type T Self::try_decode needs to be used.

Enums§

Era
An era to describe the longevity of a transaction.
FetchChainspecError
Possible errors encountered trying to fetch a chain spec from an RPC node.
Maybe
A unit marker enum.
MultiAddress
A multi-format address wrapper for on-chain accounts. This is a simplified version of Substrate’s sp_runtime::MultiAddress.
MultiSignature
Signature container that can store known signature types. This is a simplified version of sp_runtime::MultiSignature. To obtain more functionality, convert this into that type.
No
A unit marker enum.
RangeMapError
An error that can occur when calling RangeMapBuilder::try_add_range().
Yes
A unit marker enum.

Traits§

NoMaybe
This is implemented for No and Maybe and allows us to check at runtime which of these types is present.
YesMaybe
This is implemented for Yes and Maybe and allows us to check at runtime which of these types is present.
YesNo
This is implemented for Yes and No and allows us to check at runtime which of these types is present.

Functions§

fetch_chainspec_from_rpc_node
Fetch a chain spec from an RPC node at the given URL.
strip_compact_prefix
Decodes a compact encoded value from the beginning of the provided bytes, returning the value and any remaining bytes.
to_hex
A quick helper to encode some bytes to hex.

Type Aliases§

KeyedVec
This represents a key-value collection and is SCALE compatible with collections like BTreeMap. This has the same type params as BTreeMap which allows us to easily swap the two during codegen.