Bounded

Variant 485 v393

frame_support::traits::preimages::Bounded

About This Type

Enum type: Bounded.

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
0Legacy
hash: H256
1Inline
2Lookup
hash: H256
len: u32

SCALE Encoding

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

Examples

Legacy = Legacy(hash)
0x00<field0>
00 Variant index 0 = Legacy
field 0 hash: H256
Inline = Inline(BoundedVec)
0x01<field0>
01 Variant index 1 = Inline
field 0 field0: BoundedVec
Lookup = Lookup(hash, len)
0x02<field0><field1>
02 Variant index 2 = Lookup
field 0 hash: H256
field 1 len: u32

Code Examples

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

const registry = new TypeRegistry();

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

Type Parameters

T = RuntimeCall
H = BlakeTwo256

Referenced By (2)

Type Information

Type ID
485
Kind
Variant
Path
frame_support::traits::preimages::Bounded
Runtime
v393