Struct substrate_test_runtime::Runtime [−][src]
pub struct Runtime;
Trait Implementations
Get current account nonce of given AccountId
.
Returns the slot duration for Aura. Read more
Return the genesis configuration for BABE. The configuration is only read on genesis.
Returns the slot that started the current epoch.
Returns information regarding the current epoch.
Returns information regarding the next epoch (which was already previously announced). Read more
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. Read more
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. Read more
Apply the given extrinsic. Read more
Finish the current block.
Generate inherent extrinsics. The inherent data will vary from chain to chain.
Check that the inherents are valid. The inherent data will vary from chain to chain.
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 = RuntimeBlockLength
type BlockLength = RuntimeBlockLength
The maximum length of a block (in bytes).
Account index (aka nonce) type. This stores the number of previous transactions associated with a sender account. Read more
type BlockNumber = u64
type BlockNumber = u64
The block number type used by the runtime.
type Lookup = IdentityLookup<Self::AccountId>
type Lookup = IdentityLookup<Self::AccountId>
Converting trait to take a source type and convert to AccountId
. Read more
type BlockHashCount = BlockHashCount
type BlockHashCount = BlockHashCount
Maximum number of block number to block hash mappings to keep (oldest pruned first).
type PalletInfo = Self
type PalletInfo = Self
Provides information about the pallet setup in the runtime. Read more
type AccountData = ()
type AccountData = ()
Data to be associated with an account (other than nonce/transaction counter, which this pallet does regardless). Read more
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 SS85 prefix of this chain. Read more
type OnTimestampSet = ()
type OnTimestampSet = ()
Something which can be notified when the timestamp is set. Set this to ()
if not
needed. Read more
type MinimumPeriod = MinimumPeriod
type MinimumPeriod = MinimumPeriod
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. Read more
type WeightInfo = ()
type WeightInfo = ()
Weight information for extrinsics in this pallet.
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. Read more
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). Read more
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. Read more
type KeyOwnerProofSystem = ()
type KeyOwnerProofSystem = ()
A system for proving ownership of keys, i.e. that a given key was part of a validator set, needed for validating equivocation reports. Read more
type KeyOwnerProof = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, AuthorityId)>>::Proof
type KeyOwnerProof = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, AuthorityId)>>::Proof
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. Read more
type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, AuthorityId)>>::IdentificationTuple
type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, AuthorityId)>>::IdentificationTuple
The identification of a key owner, used when reporting equivocations.
type HandleEquivocation = ()
type HandleEquivocation = ()
The equivocation handling subsystem, defines methods to report an
offence (after the equivocation has been validated) and for submitting a
transaction to report an equivocation (from an offchain context).
NOTE: when enabling equivocation handling (i.e. this type isn’t set to
()
) you must use this pallet’s ValidateUnsigned
in the runtime
definition. Read more
type WeightInfo = ()
Returns the version of the runtime.
Execute the given block.
Initialize a block with the given header.
type RuntimeBlock = Block
type RuntimeBlock = Block
The RuntimeBlock
type.
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
Get current GRANDPA authority set id.
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. Read more
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. Read more
Returns the metadata of a runtime.
Starts the off-chain task for given block header.
Generate a set of session keys with optionally using the given seed. The keys should be stored within the keystore exposed via runtime externalities. Read more
fn validate_transaction(
_source: TransactionSource,
utx: <Block as BlockT>::Extrinsic,
_: <Block as BlockT>::Hash
) -> TransactionValidity
fn validate_transaction(
_source: TransactionSource,
utx: <Block as BlockT>::Extrinsic,
_: <Block as BlockT>::Hash
) -> TransactionValidity
Validate the transaction. Read more
Auto Trait Implementations
impl RefUnwindSafe for Runtime
impl UnwindSafe for Runtime
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more