Module utils

Source
Expand description

Miscellaneous utility helpers.

Modules§

bits
Generic scale_bits over bitvec-like BitOrder and BitFormat types.

Structs§

AccountId20
Ethereum-compatible AccountId.
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.
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.
Yes
A unit marker struct.

Enums§

Era
An era to describe the longevity of a transaction.
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.

Functions§

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.