AllowedSlots

Variant 714 v393

sp_consensus_babe::AllowedSlots

About This Type

Enum type: AllowedSlots.

A tagged union where the first byte selects which variant is active, followed by that variant's data.

Encoding: 1-byte variant index followed by the selected variant's field data.

Variants (3)

IndexNameFieldsDocs
0PrimarySlotsnone
1PrimaryAndSecondaryPlainSlotsnone
2PrimaryAndSecondaryVRFSlotsnone

SCALE Encoding

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

Examples

PrimarySlots
0x00
00 Variant index 0 = PrimarySlots
PrimaryAndSecondaryPlainSlots
0x01
01 Variant index 1 = PrimaryAndSecondaryPlainSlots
PrimaryAndSecondaryVRFSlots
0x02
02 Variant index 2 = PrimaryAndSecondaryVRFSlots

Code Examples

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

const registry = new TypeRegistry();

// Encode AllowedSlots — variant "PrimarySlots"
const value = registry.createType("AllowedSlots", "PrimarySlots");
console.log("Hex:", value.toHex());

Referenced By (2)

Type Information

Type ID
714
Kind
Variant
Path
sp_consensus_babe::AllowedSlots
Runtime
v393