-
Hugo Trentesaux authored
* fix renaming RuntimeCall * cargo xtask gen-calls-doc and update metadata * doc storage * more doc * doc identity * doc calls
Hugo Trentesaux authored* fix renaming RuntimeCall * cargo xtask gen-calls-doc and update metadata * doc storage * more doc * doc identity * doc calls
Runtime calls
Calls are categorized according to the dispatch origin they require:
- User calls: the dispatch origin for this kind of call must be signed by the transactor. This is the only call category that can be submitted with an extrinsic.
- Root calls: This kind of call requires a special origin that can only be invoked through on-chain governance mechanisms.
- Inherent calls: This kind of call is invoked by the author of the block itself (usually automatically by the node).
- Disabled calls: These calls can not be called directly, they are reserved for internal use by other runtime calls.
User calls
There are 68 user calls from 21 pallets.
Scheduler - 2
schedule - 0
schedule(when, maybe_periodic, priority, call)
when: T::BlockNumber
maybe_periodic: Option<schedule::Period<T::BlockNumber>>
priority: schedule::Priority
call: Box<<T as Config>::RuntimeCall>
Anonymously schedule a task.
cancel - 1
cancel(when, index)
when: T::BlockNumber
index: u32
Cancel an anonymously scheduled task.
schedule_named - 2
schedule_named(id, when, maybe_periodic, priority, call)
id: TaskName
when: T::BlockNumber
maybe_periodic: Option<schedule::Period<T::BlockNumber>>
priority: schedule::Priority
call: Box<<T as Config>::RuntimeCall>
Schedule a named task.
cancel_named - 3
cancel_named(id)
id: TaskName
Cancel a named scheduled task.
schedule_after - 4
schedule_after(after, maybe_periodic, priority, call)
after: T::BlockNumber
maybe_periodic: Option<schedule::Period<T::BlockNumber>>
priority: schedule::Priority
call: Box<<T as Config>::RuntimeCall>
Anonymously schedule a task after a delay.
schedule_named_after - 5
schedule_named_after(id, after, maybe_periodic, priority, call)
id: TaskName
after: T::BlockNumber
maybe_periodic: Option<schedule::Period<T::BlockNumber>>
priority: schedule::Priority
call: Box<<T as Config>::RuntimeCall>
Schedule a named task after a delay.
Babe - 3
report_equivocation - 0
report_equivocation(equivocation_proof, key_owner_proof)
equivocation_proof: Box<EquivocationProof<T::Header>>
key_owner_proof: T::KeyOwnerProof
Report authority equivocation/misbehavior. This method will verify the equivocation proof and validate the given key ownership proof against the extracted offender. If both are valid, the offence will be reported.
Balances - 6
transfer - 0
transfer(dest, value)
dest: AccountIdLookupOf<T>
value: T::Balance
Transfer some liquid free balance to another account.
transfer
will set the FreeBalance
of the sender and receiver.
If the sender's account is below the existential deposit as a result
of the transfer, the account will be reaped.
The dispatch origin for this call must be Signed
by the transactor.
transfer_keep_alive - 3
transfer_keep_alive(dest, value)
dest: AccountIdLookupOf<T>
value: T::Balance
Same as the transfer
call, but with a check that the transfer will not kill the
origin account.
99% of the time you want transfer
instead.
transfer_all - 4
transfer_all(dest, keep_alive)
dest: AccountIdLookupOf<T>
keep_alive: bool
Transfer the entire transferable balance from the caller account.
NOTE: This function only attempts to transfer transferable balances. This means that
any locked, reserved, or existential deposits (when keep_alive
is true
), will not be
transferred by this function. To ensure that this function results in a killed account,
you might need to prepare the account by removing any reference counters, storage
deposits, etc...
The dispatch origin of this call must be Signed.
-
dest
: The recipient of the transfer. -
keep_alive
: A boolean to determine if thetransfer_all
operation should send all of the funds the account has, causing the sender account to be killed (false), or transfer everything except at least the existential deposit, which will guarantee to keep the sender account alive (true). # - O(1). Just like transfer, but reading the user's transferable balance first. #
OneshotAccount - 7
create_oneshot_account - 0
create_oneshot_account(dest, value)
dest: <T::Lookup as StaticLookup>::Source
value: <T::Currency as Currency<T::AccountId>>::Balance
Create an account that can only be consumed once
-
dest
: The oneshot account to be created. -
balance
: The balance to be transfered to this oneshot account.
Origin account is kept alive.
consume_oneshot_account - 1
consume_oneshot_account(block_height, dest)
block_height: T::BlockNumber
dest: Account<<T::Lookup as StaticLookup>::Source>
Consume a oneshot account and transfer its balance to an account
-
block_height
: Must be a recent block number. The limit isBlockHashCount
in the past. (this is to prevent replay attacks) -
dest
: The destination account. -
dest_is_oneshot
: If set totrue
, then a oneshot account is created atdest
. Else,dest
has to be an existing account.
consume_oneshot_account_with_remaining - 2
consume_oneshot_account_with_remaining(block_height, dest, remaining_to, balance)
block_height: T::BlockNumber
dest: Account<<T::Lookup as StaticLookup>::Source>
remaining_to: Account<<T::Lookup as StaticLookup>::Source>
balance: <T::Currency as Currency<T::AccountId>>::Balance
Consume a oneshot account then transfer some amount to an account, and the remaining amount to another account.
-
block_height
: Must be a recent block number. The limit isBlockHashCount
in the past. (this is to prevent replay attacks) -
dest
: The destination account. -
dest_is_oneshot
: If set totrue
, then a oneshot account is created atdest
. Else,dest
has to be an existing account. -
dest2
: The second destination account. -
dest2_is_oneshot
: If set totrue
, then a oneshot account is created atdest2
. Else,dest2
has to be an existing account. -
balance1
: The amount transfered todest
, the leftover being transfered todest2
.
AuthorityMembers - 10
go_offline - 0
go_offline()
ask to leave the set of validators two sessions after
go_online - 1
go_online()
ask to join the set of validators two sessions after
set_session_keys - 2
set_session_keys(keys)
keys: T::KeysWrapper
declare new session keys to replace current ones
Grandpa - 15
report_equivocation - 0
report_equivocation(equivocation_proof, key_owner_proof)
equivocation_proof: Box<EquivocationProof<T::Hash, T::BlockNumber>>
key_owner_proof: T::KeyOwnerProof
Report voter equivocation/misbehavior. This method will verify the equivocation proof and validate the given key ownership proof against the extracted offender. If both are valid, the offence will be reported.
UpgradeOrigin - 21
dispatch_as_root_unchecked_weight - 1
dispatch_as_root_unchecked_weight(call, weight)
call: Box<<T as Config>::Call>
weight: Weight
Dispatches a function call from root origin. This function does not check the weight of the call, and instead allows the caller to specify the weight of the call.
The weight of this call is defined by the caller.
Preimage - 22
note_preimage - 0
note_preimage(bytes)
bytes: Vec<u8>
Register a preimage on-chain.
If the preimage was previously requested, no fees or deposits are taken for providing the preimage. Otherwise, a deposit is taken proportional to the size of the preimage.
unnote_preimage - 1
unnote_preimage(hash)
hash: T::Hash
Clear an unrequested preimage from the runtime storage.
If len
is provided, then it will be a much cheaper operation.
-
hash
: The hash of the preimage to be removed from the store. -
len
: The length of the preimage ofhash
.
request_preimage - 2
request_preimage(hash)
hash: T::Hash
Request a preimage be uploaded to the chain without paying any fees or deposits.