Type Definition frame_system::pallet::Module [−][src]
type Module<T> = Pallet<T>;
Type alias to Pallet
, to be used by construct_runtime
.
Generated by pallet
attribute macro.
Implementations
impl<T: Config> Module<T>
[src]
pub fn account_exists(who: &T::AccountId) -> bool
[src]
pub fn inc_ref(who: &T::AccountId)
[src]
Use inc_consumers
instead
Increment the reference counter on an account.
pub fn dec_ref(who: &T::AccountId)
[src]
Use dec_consumers
instead
Decrement the reference counter on an account. This MUST only be done once for every time
you called inc_consumers
on who
.
pub fn refs(who: &T::AccountId) -> RefCount
[src]
Use consumers
instead
The number of outstanding references for the account who
.
pub fn allow_death(who: &T::AccountId) -> bool
[src]
Use !is_provider_required
instead
True if the account has no outstanding references.
pub fn inc_providers(who: &T::AccountId) -> IncRefStatus
[src]
Increment the reference counter on an account.
The account who
’s providers
must be non-zero or this will return an error.
pub fn dec_providers(who: &T::AccountId) -> Result<DecRefStatus, DecRefError>
[src]
Decrement the reference counter on an account. This MUST only be done once for every time
you called inc_consumers
on who
.
pub fn providers(who: &T::AccountId) -> RefCount
[src]
The number of outstanding references for the account who
.
pub fn inc_consumers(who: &T::AccountId) -> Result<(), IncRefError>
[src]
Increment the reference counter on an account.
The account who
’s providers
must be non-zero or this will return an error.
pub fn dec_consumers(who: &T::AccountId)
[src]
Decrement the reference counter on an account. This MUST only be done once for every time
you called inc_consumers
on who
.
pub fn consumers(who: &T::AccountId) -> RefCount
[src]
The number of outstanding references for the account who
.
pub fn is_provider_required(who: &T::AccountId) -> bool
[src]
True if the account has some outstanding references.
pub fn deposit_event(event: impl Into<T::Event>)
[src]
Deposits an event into this block’s event record.
pub fn deposit_event_indexed(topics: &[T::Hash], event: T::Event)
[src]
Deposits an event into this block’s event record adding this event to the corresponding topic indexes.
This will update storage entries that correspond to the specified topics. It is expected that light-clients could subscribe to this topics.
pub fn extrinsic_index() -> Option<u32>
[src]
Gets the index of extrinsic that is currently executing.
pub fn extrinsic_count() -> u32
[src]
Gets extrinsics count.
pub fn all_extrinsics_len() -> u32
[src]
pub fn register_extra_weight_unchecked(weight: Weight, class: DispatchClass)
[src]
Inform the system pallet of some additional weight that should be accounted for, in the current block.
NOTE: use with extra care; this function is made public only be used for certain pallets
that need it. A runtime that does not have dynamic calls should never need this and should
stick to static weights. A typical use case for this is inner calls or smart contract calls.
Furthermore, it only makes sense to use this when it is presumably cheap to provide the
argument weight
; In other words, if this function is to be used to account for some
unknown, user provided call’s weight, it would only make sense to use it if you are sure you
can rapidly compute the weight of the inner call.
Even more dangerous is to note that this function does NOT take any action, if the new sum of block weight is more than the block weight limit. This is what the unchecked.
Another potential use-case could be for the on_initialize
and on_finalize
hooks.
pub fn initialize(
number: &T::BlockNumber,
parent_hash: &T::Hash,
digest: &DigestOf<T>,
kind: InitKind
)
[src]
number: &T::BlockNumber,
parent_hash: &T::Hash,
digest: &DigestOf<T>,
kind: InitKind
)
Start the execution of a particular block.
pub fn finalize() -> T::Header
[src]
Remove temporary “environment” entries in storage, compute the storage root and return the resulting header for this block.
pub fn deposit_log(item: DigestItemOf<T>)
[src]
pub fn externalities() -> TestExternalities
[src]
Get the basic externalities for this pallet, useful for tests.
pub fn set_block_number(n: T::BlockNumber)
[src]
Set the block number to something in particular. Can be used as an alternative to
initialize
for tests that don’t need to bother with the other environment entries.
pub fn set_extrinsic_index(extrinsic_index: u32)
[src]
Sets the index of extrinsic that is currently executing.
pub fn set_parent_hash(n: T::Hash)
[src]
Set the parent hash number to something in particular. Can be used as an alternative to
initialize
for tests that don’t need to bother with the other environment entries.
pub fn set_block_consumed_resources(weight: Weight, len: usize)
[src]
Set the current block weight. This should only be used in some integration tests.
pub fn reset_events()
[src]
Reset events. Can be used as an alternative to
initialize
for tests that don’t need to bother with the other environment entries.
pub fn runtime_version() -> RuntimeVersion
[src]
Return the chain’s current runtime version.
pub fn account_nonce(who: impl EncodeLike<T::AccountId>) -> T::Index
[src]
Retrieve the account transaction counter from storage.
pub fn inc_account_nonce(who: impl EncodeLike<T::AccountId>)
[src]
Increment a particular account’s nonce by 1.
pub fn note_extrinsic(encoded_xt: Vec<u8>)
[src]
Note what the extrinsic data of the current extrinsic index is.
This is required to be called before applying an extrinsic. The data will used
in Self::finalize
to calculate the correct extrinsics root.
pub fn note_applied_extrinsic(
r: &DispatchResultWithPostInfo,
info: DispatchInfo
)
[src]
r: &DispatchResultWithPostInfo,
info: DispatchInfo
)
To be called immediately after an extrinsic has been applied.
pub fn note_finished_extrinsics()
[src]
To be called immediately after note_applied_extrinsic
of the last extrinsic of the block
has been called.
pub fn note_finished_initialize()
[src]
To be called immediately after finishing the initialization of the block
(e.g., called on_initialize
for all pallets).
pub fn on_created_account(
who: T::AccountId,
_a: &mut AccountInfo<T::Index, T::AccountData>
)
[src]
who: T::AccountId,
_a: &mut AccountInfo<T::Index, T::AccountData>
)
An account is being created.
pub fn can_set_code(code: &[u8]) -> Result<(), DispatchError>
[src]
Determine whether or not it is possible to update the code.
Checks the given code if it is a valid runtime wasm blob by instantianting it and extracting the runtime version of it. It checks that the runtime version of the old and new runtime has the same spec name and that the spec version is increasing.