Sudo¶
Calls¶
set_key¶
Authenticates the current sudo key and sets the given AccountId (new
) as the new sudo
key.
The dispatch origin for this call must be Signed.
## Complexity - O(1).
Attributes¶
Name | Type |
---|---|
new | AccountIdLookupOf<T> |
Python¶
call = substrate.compose_call(
'Sudo', 'set_key', {'new': 'AccountId'}
)
sudo¶
Authenticates the sudo key and dispatches a function call with Root
origin.
The dispatch origin for this call must be Signed.
## Complexity - O(1).
Attributes¶
Name | Type |
---|---|
call | Box<<T as Config>::RuntimeCall> |
Python¶
call = substrate.compose_call(
'Sudo', 'sudo', {'call': 'Call'}
)
sudo_as¶
Authenticates the sudo key and dispatches a function call with Signed
origin from
a given account.
The dispatch origin for this call must be Signed.
## Complexity - O(1).
Attributes¶
Name | Type |
---|---|
who | AccountIdLookupOf<T> |
call | Box<<T as Config>::RuntimeCall> |
Python¶
call = substrate.compose_call(
'Sudo', 'sudo_as', {'call': 'Call', 'who': 'AccountId'}
)
sudo_unchecked_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.
## Complexity - O(1).
Attributes¶
Name | Type |
---|---|
call | Box<<T as Config>::RuntimeCall> |
weight | Weight |
Python¶
call = substrate.compose_call(
'Sudo', 'sudo_unchecked_weight', {
'call': 'Call',
'weight': {
'proof_size': 'u64',
'ref_time': 'u64',
},
}
)
Events¶
KeyChanged¶
The [sudoer] just switched identity; the old key is supplied if one existed.
Attributes¶
Name | Type | Composition |
---|---|---|
old_sudoer | Option<T::AccountId> |
(None, 'AccountId') |
Sudid¶
A sudo just took place. [result]
Attributes¶
Name | Type | Composition |
---|---|---|
sudo_result | DispatchResult |
{'Ok': (), 'Err': {'Other': None, 'CannotLookup': None, 'BadOrigin': None, 'Module': {'index': 'u8', 'error': '[u8; 4]'}, 'ConsumerRemaining': None, 'NoProviders': None, 'TooManyConsumers': None, 'Token': ('FundsUnavailable', 'OnlyProvider', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported', 'CannotCreateHold', 'NotExpendable'), 'Arithmetic': ('Underflow', 'Overflow', 'DivisionByZero'), 'Transactional': ('LimitReached', 'NoLayer'), 'Exhausted': None, 'Corruption': None, 'Unavailable': None}} |
SudoAsDone¶
A sudo just took place. [result]
Attributes¶
Name | Type | Composition |
---|---|---|
sudo_result | DispatchResult |
{'Ok': (), 'Err': {'Other': None, 'CannotLookup': None, 'BadOrigin': None, 'Module': {'index': 'u8', 'error': '[u8; 4]'}, 'ConsumerRemaining': None, 'NoProviders': None, 'TooManyConsumers': None, 'Token': ('FundsUnavailable', 'OnlyProvider', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported', 'CannotCreateHold', 'NotExpendable'), 'Arithmetic': ('Underflow', 'Overflow', 'DivisionByZero'), 'Transactional': ('LimitReached', 'NoLayer'), 'Exhausted': None, 'Corruption': None, 'Unavailable': None}} |
Storage functions¶
Key¶
The AccountId
of the sudo key.
Python¶
result = substrate.query(
'Sudo', 'Key', []
)
Return value¶
'AccountId'
Errors¶
RequireSudo¶
Sender must be the Sudo account