Skip to content
Snippets Groups Projects
Select Git revision
  • c5eb2e70dd5dc81ea7a5a5cebba35753a13f5363
  • master default protected
  • network/gdev-800 protected
  • cgeek/issue-297-cpu
  • gdev-800-tests
  • update-docker-compose-rpc-squid-names
  • fix-252
  • 1000i100-test
  • hugo/tmp-0.9.1
  • network/gdev-803 protected
  • hugo/endpoint-gossip
  • network/gdev-802 protected
  • hugo/distance-precompute
  • network/gdev-900 protected
  • tuxmain/anonymous-tx
  • debug/podman
  • hugo/195-doc
  • hugo/195-graphql-schema
  • hugo-tmp-dockerfile-cache
  • release/client-800.2 protected
  • release/runtime-800 protected
  • gdev-900-0.10.1 protected
  • gdev-900-0.10.0 protected
  • gdev-900-0.9.2 protected
  • gdev-800-0.8.0 protected
  • gdev-900-0.9.1 protected
  • gdev-900-0.9.0 protected
  • gdev-803 protected
  • gdev-802 protected
  • runtime-801 protected
  • gdev-800 protected
  • runtime-800-bis protected
  • runtime-800 protected
  • runtime-800-backup protected
  • runtime-701 protected
  • runtime-700 protected
  • runtime-600 protected
  • runtime-500 protected
  • v0.4.1 protected
  • runtime-401 protected
  • v0.4.0 protected
41 results

runtime-calls.md

Blame
    • Hugo Trentesaux's avatar
      5a3f0654
      refac membership renewal (!166) · 5a3f0654
      Hugo Trentesaux authored and Pascal Engélibert's avatar Pascal Engélibert committed
      * review tuxmain
      
      * fix rebase
      
      * rename force_add_cert to do_add_cert_checked
      
      * remove origin from force_add_cert
      
      * remove duplicate UD handling
      
      * claim membership - validating identity
      
      ensure claim membership does not prevent validating identity
      
      * clippy
      
      * add acquired membership handler
      
      and new integration test scenario
      
      * run benchmarks
      
      * refactor claim_membership
      
      and expire membership instead of revoking
      when too few certs
      
      * re-enable claim_membership
      
      * membership expiry no identity removal
      
      membership expiry no more triggers identity removal
      
      * control by test
      
      * at membership expiry : back to pending membership
      
      * reveal identity removal on membership expiry
      
      * refac test
      
      * refac membership renewal
      
      add expiry unscheduling
      do not verify expiration block expiring memberships
      add and refac tests
      add integration test
      
      * wip
      5a3f0654
      History
      refac membership renewal (!166)
      Hugo Trentesaux authored and Pascal Engélibert's avatar Pascal Engélibert committed
      * review tuxmain
      
      * fix rebase
      
      * rename force_add_cert to do_add_cert_checked
      
      * remove origin from force_add_cert
      
      * remove duplicate UD handling
      
      * claim membership - validating identity
      
      ensure claim membership does not prevent validating identity
      
      * clippy
      
      * add acquired membership handler
      
      and new integration test scenario
      
      * run benchmarks
      
      * refactor claim_membership
      
      and expire membership instead of revoking
      when too few certs
      
      * re-enable claim_membership
      
      * membership expiry no identity removal
      
      membership expiry no more triggers identity removal
      
      * control by test
      
      * at membership expiry : back to pending membership
      
      * reveal identity removal on membership expiry
      
      * refac test
      
      * refac membership renewal
      
      add expiry unscheduling
      do not verify expiration block expiring memberships
      add and refac tests
      add integration test
      
      * wip
    runtime-calls.md 42.77 KiB

    Runtime calls

    Calls are categorized according to the dispatch origin they require:

    1. 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.
    2. Root calls: This kind of call requires a special origin that can only be invoked through on-chain governance mechanisms.
    3. Inherent calls: This kind of call is invoked by the author of the block itself (usually automatically by the node).
    4. Disabled calls: These calls can not be called directly, they are reserved for internal use by other runtime calls.

    User calls

    There are 69 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 the transfer_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 is BlockHashCount in the past. (this is to prevent replay attacks)
    • dest: The destination account.
    • dest_is_oneshot: If set to true, then a oneshot account is created at dest. 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 is BlockHashCount in the past. (this is to prevent replay attacks)
    • dest: The destination account.
    • dest_is_oneshot: If set to true, then a oneshot account is created at dest. Else, dest has to be an existing account.
    • dest2: The second destination account.
    • dest2_is_oneshot: If set to true, then a oneshot account is created at dest2. Else, dest2 has to be an existing account.
    • balance1: The amount transfered to dest, the leftover being transfered to dest2.

    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 of hash.

    request_preimage - 2

    request_preimage(hash)
    hash: T::Hash

    Request a preimage be uploaded to the chain without paying any fees or deposits.

    If the preimage requests has already been provided on-chain, we unreserve any deposit a user may have paid, and take the control of the preimage out of their hands.

    unrequest_preimage - 3

    unrequest_preimage(hash)
    hash: T::Hash

    Clear a previously made request for a preimage.

    NOTE: THIS MUST NOT BE CALLED ON hash MORE TIMES THAN request_preimage.

    TechnicalCommittee - 23

    execute - 1

    execute(proposal, length_bound)
    proposal: Box<<T as Config<I>>::Proposal>
    length_bound: u32

    Dispatch a proposal from a member using the Member origin.

    Origin must be a member of the collective.

    propose - 2

    propose(threshold, proposal, length_bound)
    threshold: MemberCount
    proposal: Box<<T as Config<I>>::Proposal>
    length_bound: u32

    Add a new proposal to either be voted on or executed directly.

    Requires the sender to be member.

    threshold determines whether proposal is executed directly (threshold < 2) or put up for voting.

    vote - 3

    vote(proposal, index, approve)
    proposal: T::Hash
    index: ProposalIndex
    approve: bool

    Add an aye or nay vote for the sender to the given proposal.

    Requires the sender to be a member.

    Transaction fees will be waived if the member is voting on any particular proposal for the first time and the call is successful. Subsequent vote changes will charge a fee.

    close_old_weight - 4

    close_old_weight(proposal_hash, index, proposal_weight_bound, length_bound)
    proposal_hash: T::Hash
    index: ProposalIndex
    proposal_weight_bound: OldWeight
    length_bound: u32

    Close a vote that is either approved, disapproved or whose voting period has ended.

    May be called by any signed account in order to finish voting and close the proposal.

    If called before the end of the voting period it will only close the vote if it is has enough votes to be approved or disapproved.

    If called after the end of the voting period abstentions are counted as rejections unless there is a prime member set and the prime member cast an approval.

    If the close operation completes successfully with disapproval, the transaction fee will be waived. Otherwise execution of the approved operation will be charged to the caller.

    • proposal_weight_bound: The maximum amount of weight consumed by executing the closed proposal.
    • length_bound: The upper bound for the length of the proposal in storage. Checked via storage::read so it is size_of::<u32>() == 4 larger than the pure length.

    close - 6

    close(proposal_hash, index, proposal_weight_bound, length_bound)
    proposal_hash: T::Hash
    index: ProposalIndex
    proposal_weight_bound: Weight
    length_bound: u32

    Close a vote that is either approved, disapproved or whose voting period has ended.

    May be called by any signed account in order to finish voting and close the proposal.

    If called before the end of the voting period it will only close the vote if it is has enough votes to be approved or disapproved.

    If called after the end of the voting period abstentions are counted as rejections unless there is a prime member set and the prime member cast an approval.

    If the close operation completes successfully with disapproval, the transaction fee will be waived. Otherwise execution of the approved operation will be charged to the caller.

    • proposal_weight_bound: The maximum amount of weight consumed by executing the closed proposal.
    • length_bound: The upper bound for the length of the proposal in storage. Checked via storage::read so it is size_of::<u32>() == 4 larger than the pure length.

    UniversalDividend - 30

    claim_uds - 0

    claim_uds()

    Claim Universal Dividends

    transfer_ud - 1

    transfer_ud(dest, value)
    dest: <T::Lookup as StaticLookup>::Source
    value: BalanceOf<T>

    Transfer some liquid free balance to another account, in milliUD.

    transfer_ud_keep_alive - 2

    transfer_ud_keep_alive(dest, value)
    dest: <T::Lookup as StaticLookup>::Source
    value: BalanceOf<T>

    Transfer some liquid free balance to another account, in milliUD.

    Identity - 41

    create_identity - 0

    create_identity(owner_key)
    owner_key: T::AccountId

    Create an identity for an existing account

    • owner_key: the public key corresponding to the identity to be created

    The origin must be allowed to create an identity.

    confirm_identity - 1

    confirm_identity(idty_name)
    idty_name: IdtyName

    Confirm the creation of an identity and give it a name

    • idty_name: the name uniquely associated to this identity. Must match the validation rules defined by the runtime.

    The identity must have been created using create_identity before it can be confirmed.

    validate_identity - 2

    validate_identity(idty_index)
    idty_index: T::IdtyIndex

    validate the owned identity (must meet the main wot requirements)

    change_owner_key - 3

    change_owner_key(new_key, new_key_sig)
    new_key: T::AccountId
    new_key_sig: T::NewOwnerKeySignature

    Change identity owner key.

    • new_key: the new owner key.
    • new_key_sig: the signature of the encoded form of NewOwnerKeyPayload. Must be signed by new_key.

    The origin should be the old identity owner key.

    revoke_identity - 4

    revoke_identity(idty_index, revocation_key, revocation_sig)
    idty_index: T::IdtyIndex
    revocation_key: T::AccountId
    revocation_sig: T::RevocationSignature

    Revoke an identity using a revocation signature

    • idty_index: the index of the identity to be revoked.
    • revocation_key: the key used to sign the revocation payload.
    • revocation_sig: the signature of the encoded form of RevocationPayload. Must be signed by revocation_key.

    Any signed origin can execute this call.

    fix_sufficients - 7

    fix_sufficients(owner_key, inc)
    owner_key: T::AccountId
    inc: bool

    change sufficient ref count for given key

    Membership - 42

    claim_membership - 1

    claim_membership()

    claim pending membership to become actual memberhip the requested membership must fullfill requirements

    renew_membership - 2

    renew_membership()

    extend the validity period of an active membership

    Cert - 43

    add_cert - 0

    add_cert(issuer, receiver)
    issuer: T::IdtyIndex
    receiver: T::IdtyIndex

    Add a new certification or renew an existing one

    • receiver: the account receiving the certification from the origin

    The origin must be allow to certify.

    SmithMembership - 52

    request_membership - 0

    request_membership(metadata)
    metadata: T::MetaData

    submit a membership request (must have a declared identity) (only available for sub wot, automatic for main wot)

    claim_membership - 1

    claim_membership()

    claim pending membership to become actual memberhip the requested membership must fullfill requirements

    renew_membership - 2

    renew_membership()

    extend the validity period of an active membership

    revoke_membership - 3

    revoke_membership()

    revoke an active membership (only available for sub wot, automatic for main wot)

    SmithCert - 53

    add_cert - 0

    add_cert(issuer, receiver)
    issuer: T::IdtyIndex
    receiver: T::IdtyIndex

    Add a new certification or renew an existing one

    • receiver: the account receiving the certification from the origin

    The origin must be allow to certify.

    AtomicSwap - 60

    create_swap - 0

    create_swap(target, hashed_proof, action, duration)
    target: T::AccountId
    hashed_proof: HashedProof
    action: T::SwapAction
    duration: T::BlockNumber

    Register a new atomic swap, declaring an intention to send funds from origin to target on the current blockchain. The target can claim the fund using the revealed proof. If the fund is not claimed after duration blocks, then the sender can cancel the swap.

    The dispatch origin for this call must be Signed.