Sudo::Event

Variant 57 v393

pallet_sudo::pallet::Event

The `Event` enum of this pallet

About This Type

Event enum for the Event pallet.

Contains all possible events emitted by the Event pallet. Each variant represents a different event type with its own data fields.

Variants (4)

IndexNameFieldsDocs
0Sudid
sudo_result: Result
A sudo call just took place.
1KeyChanged
old: Option
The sudo key has been updated.
2KeyRemovednoneThe key was permanently removed.
3SudoAsDone
sudo_result: Result
A [sudo_as](Pallet::sudo_as) call just took place.

SCALE Encoding

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

Examples

Sudid = Sudid(sudo_result)
0x00<field0>
00 Variant index 0 = Sudid
field 0 sudo_result: Result
KeyChanged = KeyChanged(old, new)
0x01<field0><field1>
01 Variant index 1 = KeyChanged
field 0 old: Option
field 1 new: AccountId
KeyRemoved
0x02
02 Variant index 2 = KeyRemoved

Code Examples

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

const registry = new TypeRegistry();

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

Type Parameters

T

Referenced By (23)

and 3 more...

Also See

Type Information

Type ID
57
Kind
Variant
Path
pallet_sudo::pallet::Event
Runtime
v393