Sudo::Call

Variant 163 v393

pallet_sudo::pallet::Call

Contains a variant per dispatchable extrinsic that this pallet has.

About This Type

Call enum for the Call pallet.

Contains all dispatchable functions (extrinsics) for the Call pallet. Each variant represents a different callable function with its parameters.

Variants (5)

IndexNameFieldsDocs
0sudoAuthenticates the sudo key and dispatches a function call with `Root` origin.
1sudo_unchecked_weight
weight: Weight
Authenticates the sudo key and dispatches a function call with `Root` origin. This function does not check the weight of the call, and instead allows the Sudo user to specify the weight of the call. The dispatch origin for this call must be _Signed_.
2set_keyAuthenticates the current sudo key and sets the given AccountId (`new`) as the new sudo key.
3sudo_asAuthenticates the sudo key and dispatches a function call with `Signed` origin from a given account. The dispatch origin for this call must be _Signed_.
4remove_keynonePermanently removes the sudo key. **This cannot be un-done.**

SCALE Encoding

Rule
1-byte variant index followed by variant-specific field data. 5 possible variants.
Size
variable (1+ bytes)

Examples

sudo = sudo(call)
0x00<field0>
00 Variant index 0 = sudo
field 0 call: RuntimeCall
sudo_unchecked_weight = sudo_unchecked_weight(call, weight)
0x01<field0><field1>
01 Variant index 1 = sudo_unchecked_weight
field 0 call: RuntimeCall
field 1 weight: Weight
set_key = set_key(new)
0x02<field0>
02 Variant index 2 = set_key
field 0 new: MultiAddress

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode Sudo::Call — variant "sudo"
const value = registry.createType("Sudo::Call", { sudo: { call: 0 } });
console.log("Hex:", value.toHex());

Type Parameters

T

Referenced By (23)

and 3 more...

Also See

Type Information

Type ID
163
Kind
Variant
Path
pallet_sudo::pallet::Call
Runtime
v393