DigestItem
Variant 17 v393sp_runtime::generic::digest::DigestItem
About This Type
Enum type: DigestItem.
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 (5)
SCALE Encoding
- Rule
- 1-byte variant index followed by variant-specific field data. 5 possible variants.
- Size
- variable (1+ bytes)
Examples
Other = Other(Vec<u8>)
0x00<field0>00 Variant index 0 = Otherfield 0 field0: Vec<u8>Consensus = Consensus([u8; 4], Vec<u8>)
0x04<field0><field1>04 Variant index 4 = Consensusfield 0 field0: [u8; 4]field 1 field1: Vec<u8>Seal = Seal([u8; 4], Vec<u8>)
0x05<field0><field1>05 Variant index 5 = Sealfield 0 field0: [u8; 4]field 1 field1: Vec<u8>Code Examples
import { TypeRegistry } from "@polkadot/types";
const registry = new TypeRegistry();
// Encode DigestItem — variant "PreRuntime"
const value = registry.createType("DigestItem", { PreRuntime: { value: 0, value: 0 } });
console.log("Hex:", value.toHex());Referenced By (1)
Type Information
- Type ID
- 17
- Kind
- Variant
- Path
- sp_runtime::generic::digest::DigestItem
- Runtime
- v393