Struct substrate_test_runtime::Runtime
source · pub struct Runtime;
Implementations§
source§impl Runtime
impl Runtime
pub fn metadata() -> RuntimeMetadataPrefixed
pub fn metadata_at_version(version: u32) -> Option<OpaqueMetadata>
pub fn metadata_versions() -> Vec<u32>
Trait Implementations§
source§impl AccountNonceApiV1<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>, <Signature as Verify>::Signer, u64> for Runtime
impl AccountNonceApiV1<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>, <Signature as Verify>::Signer, u64> for Runtime
source§fn account_nonce(account: AccountId) -> Nonce
fn account_nonce(account: AccountId) -> Nonce
Get current account nonce of given
AccountId
.source§impl AuraApiV1<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>, Public> for Runtime
impl AuraApiV1<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>, Public> for Runtime
source§fn slot_duration() -> SlotDuration
fn slot_duration() -> SlotDuration
Returns the slot duration for Aura. Read more
Return the current set of authorities.
source§impl BabeApiV2<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
impl BabeApiV2<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
source§fn configuration() -> BabeConfiguration
fn configuration() -> BabeConfiguration
Return the configuration for BABE.
source§fn current_epoch_start() -> Slot
fn current_epoch_start() -> Slot
Returns the slot that started the current epoch.
source§fn current_epoch() -> Epoch
fn current_epoch() -> Epoch
Returns information regarding the current epoch.
source§fn next_epoch() -> Epoch
fn next_epoch() -> Epoch
Returns information regarding the next epoch (which was already
previously announced).
source§fn submit_report_equivocation_unsigned_extrinsic(
_equivocation_proof: EquivocationProof<<Block as BlockT>::Header>,
_key_owner_proof: OpaqueKeyOwnershipProof
) -> Option<()>
fn submit_report_equivocation_unsigned_extrinsic( _equivocation_proof: EquivocationProof<<Block as BlockT>::Header>, _key_owner_proof: OpaqueKeyOwnershipProof ) -> Option<()>
Submits an unsigned extrinsic to report an equivocation. The caller
must provide the equivocation proof and a key ownership proof
(should be obtained using
generate_key_ownership_proof
). The
extrinsic will be unsigned and should only be accepted for local
authorship (not to be broadcast to the network). This method returns
None
when creation of the extrinsic fails, e.g. if equivocation
reporting is disabled for the given runtime (i.e. this method is
hardcoded to return None
). Only useful in an offchain context.source§fn generate_key_ownership_proof(
_slot: Slot,
_authority_id: AuthorityId
) -> Option<OpaqueKeyOwnershipProof>
fn generate_key_ownership_proof( _slot: Slot, _authority_id: AuthorityId ) -> Option<OpaqueKeyOwnershipProof>
Generates a proof of key ownership for the given authority in the
current epoch. An example usage of this module is coupled with the
session historical module to prove that a given authority key is
tied to a given staking identity during a specific session. Proofs
of key ownership are necessary for submitting equivocation reports.
NOTE: even though the API takes a
slot
as parameter the current
implementations ignores this parameter and instead relies on this
method being called at the correct block height, i.e. any point at
which the epoch for the given slot is live on-chain. Future
implementations will instead use indexed data through an offchain
worker, not requiring older states to be available.source§impl BlockBuilderV6<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
impl BlockBuilderV6<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
source§fn apply_extrinsic(
extrinsic: <Block as BlockT>::Extrinsic
) -> ApplyExtrinsicResult
fn apply_extrinsic( extrinsic: <Block as BlockT>::Extrinsic ) -> ApplyExtrinsicResult
Apply the given extrinsic. Read more
source§fn inherent_extrinsics(_data: InherentData) -> Vec<<Block as BlockT>::Extrinsic>
fn inherent_extrinsics(_data: InherentData) -> Vec<<Block as BlockT>::Extrinsic>
Generate inherent extrinsics. The inherent data will vary from chain to chain.
source§fn check_inherents(_block: Block, _data: InherentData) -> CheckInherentsResult
fn check_inherents(_block: Block, _data: InherentData) -> CheckInherentsResult
Check that the inherents are valid. The inherent data will vary from chain to chain.
source§impl CallerTrait<<Runtime as Config>::AccountId> for OriginCaller
impl CallerTrait<<Runtime as Config>::AccountId> for OriginCaller
source§fn into_system(self) -> Option<RawOrigin<<Runtime as Config>::AccountId>>
fn into_system(self) -> Option<RawOrigin<<Runtime as Config>::AccountId>>
Extract the signer from the message if it is a
Signed
origin.source§fn as_system_ref(&self) -> Option<&RawOrigin<<Runtime as Config>::AccountId>>
fn as_system_ref(&self) -> Option<&RawOrigin<<Runtime as Config>::AccountId>>
Extract a reference to the system-level
RawOrigin
if it is that.source§fn as_signed(&self) -> Option<&AccountId>
fn as_signed(&self) -> Option<&AccountId>
Extract the signer from it if a system
Signed
origin, None
otherwise.source§impl Config<()> for Runtime
impl Config<()> for Runtime
§type MaxLocks = MaxLocks
type MaxLocks = MaxLocks
The maximum number of locks that should exist on an account.
Not strictly enforced, but used for weight estimation.
§type MaxReserves = MaxReserves
type MaxReserves = MaxReserves
The maximum number of named reserves that can exist on an account.
§type ReserveIdentifier = [u8; 8]
type ReserveIdentifier = [u8; 8]
The ID type for reserves. Read more
§type DustRemoval = ()
type DustRemoval = ()
Handler for the unbalanced reduction when removing a dust account.
§type RuntimeEvent = RuntimeEvent
type RuntimeEvent = RuntimeEvent
The overarching event type.
§type ExistentialDeposit = ExistentialDeposit
type ExistentialDeposit = ExistentialDeposit
The minimum amount required to keep an account open. MUST BE GREATER THAN ZERO! Read more
§type AccountStore = Pallet<Runtime>
type AccountStore = Pallet<Runtime>
The means of storing the balances of an account.
§type WeightInfo = SubstrateWeight<Runtime>
type WeightInfo = SubstrateWeight<Runtime>
Weight information for extrinsics in this pallet.
§type FreezeIdentifier = ()
type FreezeIdentifier = ()
The ID type for freezes.
§type MaxFreezes = ()
type MaxFreezes = ()
The maximum number of individual freeze locks that can exist on an account at any time.
§type RuntimeHoldReason = RuntimeHoldReason
type RuntimeHoldReason = RuntimeHoldReason
The overarching hold reason.
source§impl Config for Runtime
impl Config for Runtime
§type EpochDuration = EpochDuration
type EpochDuration = EpochDuration
The amount of time, in slots, that each epoch should last.
NOTE: Currently it is not possible to change the epoch duration after
the chain has started. Attempting to do so will brick block production.
§type ExpectedBlockTime = ConstU64<10000>
type ExpectedBlockTime = ConstU64<10000>
The expected average block time at which BABE should be creating
blocks. Since BABE is probabilistic it is not trivial to figure out
what the expected average block time should be based on the slot
duration and the security parameter
c
(where 1 - c
represents
the probability of a slot being empty).§type EpochChangeTrigger = SameAuthoritiesForever
type EpochChangeTrigger = SameAuthoritiesForever
BABE requires some logic to be triggered on every block to query for whether an epoch
has ended and to perform the transition to the next epoch. Read more
§type DisabledValidators = ()
type DisabledValidators = ()
A way to check whether a given validator is disabled and should not be authoring blocks.
Blocks authored by a disabled validator will lead to a panic as part of this module’s
initialization.
§type KeyOwnerProof = Void
type KeyOwnerProof = Void
The proof of key ownership, used for validating equivocation reports.
The proof must include the session index and validator count of the
session at which the equivocation occurred.
§type EquivocationReportSystem = ()
type EquivocationReportSystem = ()
The equivocation handling subsystem, defines methods to check/report an
offence and for submitting a transaction to report an equivocation
(from an offchain context).
§type WeightInfo = ()
type WeightInfo = ()
Helper for weights computations
§type MaxAuthorities = ConstU32<10>
type MaxAuthorities = ConstU32<10>
Max number of authorities allowed
§type MaxNominators = ConstU32<100>
type MaxNominators = ConstU32<100>
The maximum number of nominators for each validator.
source§impl Config for Runtime
impl Config for Runtime
§type BaseCallFilter = Everything
type BaseCallFilter = Everything
The basic call filter to use in Origin. All origins are built with this filter as base,
except Root. Read more
§type BlockWeights = RuntimeBlockWeights
type BlockWeights = RuntimeBlockWeights
Block & extrinsics weights: base values and limits.
§type BlockLength = ()
type BlockLength = ()
The maximum length of a block (in bytes).
§type RuntimeOrigin = RuntimeOrigin
type RuntimeOrigin = RuntimeOrigin
The
RuntimeOrigin
type used by dispatchable calls.§type RuntimeCall = RuntimeCall
type RuntimeCall = RuntimeCall
The aggregated
RuntimeCall
type.§type Hashing = BlakeTwo256
type Hashing = BlakeTwo256
The hashing system (algorithm) being used in the runtime (e.g. Blake2).
§type Lookup = IdentityLookup<<Runtime as Config>::AccountId>
type Lookup = IdentityLookup<<Runtime as Config>::AccountId>
Converting trait to take a source type and convert to
AccountId
. Read more§type Block = Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>
type Block = Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>
The Block type used by the runtime. This is used by
construct_runtime
to retrieve the
extrinsics or other block specific data as needed.§type RuntimeEvent = RuntimeEvent
type RuntimeEvent = RuntimeEvent
The aggregated event type of the runtime.
§type BlockHashCount = ConstU64<2400>
type BlockHashCount = ConstU64<2400>
Maximum number of block number to block hash mappings to keep (oldest pruned first).
§type PalletInfo = PalletInfo
type PalletInfo = PalletInfo
Provides information about the pallet setup in the runtime. Read more
§type AccountData = AccountData<u64>
type AccountData = AccountData<u64>
Data to be associated with an account (other than nonce/transaction counter, which this
pallet does regardless).
§type OnNewAccount = ()
type OnNewAccount = ()
Handler for when a new account has just been created.
§type OnKilledAccount = ()
type OnKilledAccount = ()
A function that is invoked when an account has been determined to be dead. Read more
type SystemWeightInfo = ()
§type SS58Prefix = ()
type SS58Prefix = ()
The designated SS58 prefix of this chain. Read more
§type MaxConsumers = ConstU32<16>
type MaxConsumers = ConstU32<16>
The maximum number of consumers allowed on a single account.
source§impl Config for Runtime
impl Config for Runtime
§type OnTimestampSet = Pallet<Runtime>
type OnTimestampSet = Pallet<Runtime>
Something which can be notified when the timestamp is set. Set this to
()
if not
needed.§type MinimumPeriod = ConstU64<500>
type MinimumPeriod = ConstU64<500>
The minimum period between blocks. Beware that this is different to the expected
period that the block production apparatus provides. Your chosen consensus system will
generally work with this to determine a sensible block time. e.g. For Aura, it will be
double this period on default settings.
§type WeightInfo = SubstrateWeight<Runtime>
type WeightInfo = SubstrateWeight<Runtime>
Weight information for extrinsics in this pallet.
source§impl CoreV4<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
impl CoreV4<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
source§fn version() -> RuntimeVersion
fn version() -> RuntimeVersion
Returns the version of the runtime.
source§fn execute_block(block: Block)
fn execute_block(block: Block)
Execute the given block.
source§impl GetRuntimeBlockType for Runtime
impl GetRuntimeBlockType for Runtime
§type RuntimeBlock = <Runtime as Config>::Block
type RuntimeBlock = <Runtime as Config>::Block
The
RuntimeBlock
type.source§impl GrandpaApiV3<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
impl GrandpaApiV3<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
Get the current GRANDPA authorities and weights. This should not change except
for when changes are scheduled and the corresponding delay has passed. Read more
source§fn current_set_id() -> SetId
fn current_set_id() -> SetId
Get current GRANDPA authority set id.
source§fn submit_report_equivocation_unsigned_extrinsic(
_equivocation_proof: EquivocationProof<<Block as BlockT>::Hash, NumberFor<Block>>,
_key_owner_proof: OpaqueKeyOwnershipProof
) -> Option<()>
fn submit_report_equivocation_unsigned_extrinsic( _equivocation_proof: EquivocationProof<<Block as BlockT>::Hash, NumberFor<Block>>, _key_owner_proof: OpaqueKeyOwnershipProof ) -> Option<()>
Submits an unsigned extrinsic to report an equivocation. The caller
must provide the equivocation proof and a key ownership proof
(should be obtained using
generate_key_ownership_proof
). The
extrinsic will be unsigned and should only be accepted for local
authorship (not to be broadcast to the network). This method returns
None
when creation of the extrinsic fails, e.g. if equivocation
reporting is disabled for the given runtime (i.e. this method is
hardcoded to return None
). Only useful in an offchain context.source§fn generate_key_ownership_proof(
_set_id: SetId,
_authority_id: AuthorityId
) -> Option<OpaqueKeyOwnershipProof>
fn generate_key_ownership_proof( _set_id: SetId, _authority_id: AuthorityId ) -> Option<OpaqueKeyOwnershipProof>
Generates a proof of key ownership for the given authority in the
given set. An example usage of this module is coupled with the
session historical module to prove that a given authority key is
tied to a given staking identity during a specific session. Proofs
of key ownership are necessary for submitting equivocation reports.
NOTE: even though the API takes a
set_id
as parameter the current
implementations ignore this parameter and instead rely on this
method being called at the correct block height, i.e. any point at
which the given set id is live on-chain. Future implementations will
instead use indexed data through an offchain worker, not requiring
older states to be available.source§impl MetadataV2<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
impl MetadataV2<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
source§fn metadata() -> OpaqueMetadata
fn metadata() -> OpaqueMetadata
Returns the metadata of a runtime.
source§fn metadata_at_version(_version: u32) -> Option<OpaqueMetadata>
fn metadata_at_version(_version: u32) -> Option<OpaqueMetadata>
Returns the metadata at a given version. Read more
source§impl OffchainWorkerApiV2<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
impl OffchainWorkerApiV2<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
source§impl PartialEq<Runtime> for Runtime
impl PartialEq<Runtime> for Runtime
source§impl SessionKeysV1<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
impl SessionKeysV1<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
source§impl TaggedTransactionQueueV3<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
impl TaggedTransactionQueueV3<Block<Header<u64, BlakeTwo256>, UncheckedExtrinsic<Public, RuntimeCall, Signature, (CheckNonce<Runtime>, CheckWeight<Runtime>, CheckSubstrateCall)>>> for Runtime
source§fn validate_transaction(
source: TransactionSource,
utx: <Block as BlockT>::Extrinsic,
block_hash: <Block as BlockT>::Hash
) -> TransactionValidity
fn validate_transaction( source: TransactionSource, utx: <Block as BlockT>::Extrinsic, block_hash: <Block as BlockT>::Hash ) -> TransactionValidity
Validate the transaction. Read more
source§impl ValidateUnsigned for Runtime
impl ValidateUnsigned for Runtime
§type Call = RuntimeCall
type Call = RuntimeCall
The call to validate
source§fn pre_dispatch(call: &Self::Call) -> Result<(), TransactionValidityError>
fn pre_dispatch(call: &Self::Call) -> Result<(), TransactionValidityError>
Validate the call right before dispatch. Read more
source§fn validate_unsigned(
source: TransactionSource,
call: &Self::Call
) -> TransactionValidity
fn validate_unsigned( source: TransactionSource, call: &Self::Call ) -> TransactionValidity
Return the validity of the call Read more
impl Config for Runtime
impl Copy for Runtime
impl Eq for Runtime
impl StructuralEq for Runtime
impl StructuralPartialEq for Runtime
Auto Trait Implementations§
impl RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnwindSafe for Runtime
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read more§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.