Trait bp_runtime::Chain
source · pub trait Chain: Send + Sync + 'static {
type BlockNumber: Parameter + Member + MaybeSerializeDeserialize + Hash + Copy + Default + MaybeDisplay + AtLeast32BitUnsigned + FromStr + AsPrimitive<usize> + Saturating + MaxEncodedLen;
type Hash: Parameter + Member + MaybeSerializeDeserialize + Hash + Ord + Copy + MaybeDisplay + Default + SimpleBitOps + AsRef<[u8]> + AsMut<[u8]> + MaxEncodedLen;
type Hasher: HashT<Output = Self::Hash>;
type Header: Parameter + HeaderT<Number = Self::BlockNumber, Hash = Self::Hash> + HeaderIdProvider<Self::Header> + MaybeSerializeDeserialize;
type AccountId: Parameter + Member + MaybeSerializeDeserialize + Debug + MaybeDisplay + Ord + MaxEncodedLen;
type Balance: AtLeast32BitUnsigned + FixedPointOperand + Parameter + Member + MaybeSerializeDeserialize + Clone + Copy + Bounded + CheckedSub + PartialOrd + SaturatingAdd + Zero + TryFrom<U256> + MaxEncodedLen;
type Nonce: Parameter + Member + MaybeSerialize + Debug + Default + MaybeDisplay + MaybeSerializeDeserialize + AtLeast32Bit + Copy + MaxEncodedLen;
type Signature: Parameter + Verify;
const ID: ChainId;
const STATE_VERSION: StateVersion;
// Required methods
fn max_extrinsic_size() -> u32;
fn max_extrinsic_weight() -> Weight;
}
Expand description
Minimal Substrate-based chain representation that may be used from no_std environment.
Required Associated Types§
sourcetype BlockNumber: Parameter + Member + MaybeSerializeDeserialize + Hash + Copy + Default + MaybeDisplay + AtLeast32BitUnsigned + FromStr + AsPrimitive<usize> + Saturating + MaxEncodedLen
type BlockNumber: Parameter + Member + MaybeSerializeDeserialize + Hash + Copy + Default + MaybeDisplay + AtLeast32BitUnsigned + FromStr + AsPrimitive<usize> + Saturating + MaxEncodedLen
A type that fulfills the abstract idea of what a Substrate block number is.
sourcetype Hash: Parameter + Member + MaybeSerializeDeserialize + Hash + Ord + Copy + MaybeDisplay + Default + SimpleBitOps + AsRef<[u8]> + AsMut<[u8]> + MaxEncodedLen
type Hash: Parameter + Member + MaybeSerializeDeserialize + Hash + Ord + Copy + MaybeDisplay + Default + SimpleBitOps + AsRef<[u8]> + AsMut<[u8]> + MaxEncodedLen
A type that fulfills the abstract idea of what a Substrate hash is.
sourcetype Hasher: HashT<Output = Self::Hash>
type Hasher: HashT<Output = Self::Hash>
A type that fulfills the abstract idea of what a Substrate hasher (a type that produces hashes) is.
sourcetype Header: Parameter + HeaderT<Number = Self::BlockNumber, Hash = Self::Hash> + HeaderIdProvider<Self::Header> + MaybeSerializeDeserialize
type Header: Parameter + HeaderT<Number = Self::BlockNumber, Hash = Self::Hash> + HeaderIdProvider<Self::Header> + MaybeSerializeDeserialize
A type that fulfills the abstract idea of what a Substrate header is.
sourcetype AccountId: Parameter + Member + MaybeSerializeDeserialize + Debug + MaybeDisplay + Ord + MaxEncodedLen
type AccountId: Parameter + Member + MaybeSerializeDeserialize + Debug + MaybeDisplay + Ord + MaxEncodedLen
The user account identifier type for the runtime.
sourcetype Balance: AtLeast32BitUnsigned + FixedPointOperand + Parameter + Member + MaybeSerializeDeserialize + Clone + Copy + Bounded + CheckedSub + PartialOrd + SaturatingAdd + Zero + TryFrom<U256> + MaxEncodedLen
type Balance: AtLeast32BitUnsigned + FixedPointOperand + Parameter + Member + MaybeSerializeDeserialize + Clone + Copy + Bounded + CheckedSub + PartialOrd + SaturatingAdd + Zero + TryFrom<U256> + MaxEncodedLen
Balance of an account in native tokens.
The chain may support multiple tokens, but this particular type is for token that is used to pay for transaction dispatch, to reward different relayers (headers, messages), etc.
Required Associated Constants§
sourceconst STATE_VERSION: StateVersion
const STATE_VERSION: StateVersion
Version of the state implementation used by this chain. This is directly related with the
TrieLayout
configuration used by the storage.
Required Methods§
sourcefn max_extrinsic_size() -> u32
fn max_extrinsic_size() -> u32
Get the maximum size (in bytes) of a Normal extrinsic at this chain.
sourcefn max_extrinsic_weight() -> Weight
fn max_extrinsic_weight() -> Weight
Get the maximum weight (compute time) that a Normal extrinsic at this chain can use.