Equivocation

Variant 127 v393

sp_consensus_grandpa::Equivocation

About This Type

Enum type: Equivocation.

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

IndexNameFieldsDocs
0Prevote
1Precommit

SCALE Encoding

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

Examples

Prevote = Prevote(Equivocation)
0x00<field0>
00 Variant index 0 = Prevote
field 0 field0: Equivocation
Precommit = Precommit(Equivocation)
0x01<field0>
01 Variant index 1 = Precommit
field 0 field0: Equivocation

Code Examples

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

const registry = new TypeRegistry();

// Encode Equivocation — variant "Prevote"
const value = registry.createType("Equivocation", { Prevote: { value: 0 } });
console.log("Hex:", value.toHex());

Type Parameters

H = H256
N = u32

Referenced By (1)

Type Information

Type ID
127
Kind
Variant
Path
sp_consensus_grandpa::Equivocation
Runtime
v393