StoredState

Variant 400 v393

pallet_grandpa::StoredState

About This Type

Enum type: StoredState.

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 (4)

IndexNameFieldsDocs
0Livenone
1PendingPause
scheduled_at: u32
delay: u32
2Pausednone
3PendingResume
scheduled_at: u32
delay: u32

SCALE Encoding

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

Examples

Live
0x00
00 Variant index 0 = Live
PendingPause = PendingPause(scheduled_at, delay)
0x01<field0><field1>
01 Variant index 1 = PendingPause
field 0 scheduled_at: u32
field 1 delay: u32
Paused
0x02
02 Variant index 2 = Paused

Code Examples

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

const registry = new TypeRegistry();

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

Type Parameters

N = u32

Type Information

Type ID
400
Kind
Variant
Path
pallet_grandpa::StoredState
Runtime
v393