Commitments::Event

Variant 69 v393

pallet_commitments::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 (3)

IndexNameFieldsDocs
0Commitment
netuid: u16
A commitment was set
1TimelockCommitment
netuid: u16
reveal_round: u64
A timelock-encrypted commitment was set
2CommitmentRevealed
netuid: u16
A timelock-encrypted commitment was auto-revealed

SCALE Encoding

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

Examples

Commitment = Commitment(netuid, who)
0x00<field0><field1>
00 Variant index 0 = Commitment
field 0 netuid: u16
field 1 who: AccountId
TimelockCommitment = TimelockCommitment(netuid, who, reveal_round)
0x01<field0><field1><field2>
01 Variant index 1 = TimelockCommitment
field 0 netuid: u16
field 1 who: AccountId
field 2 reveal_round: u64
CommitmentRevealed = CommitmentRevealed(netuid, who)
0x02<field0><field1>
02 Variant index 2 = CommitmentRevealed
field 0 netuid: u16
field 1 who: AccountId

Code Examples

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

const registry = new TypeRegistry();

// Encode Commitments::Event — variant "Commitment"
const value = registry.createType("Commitments::Event", { Commitment: { netuid: 1, who: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" } });
console.log("Hex:", value.toHex());

Type Parameters

T

Referenced By (23)

and 3 more...

Also See

Type Information

Type ID
69
Kind
Variant
Path
pallet_commitments::pallet::Event
Runtime
v393