RuntimeHoldReason

Variant 413 v393

node_subtensor_runtime::RuntimeHoldReason

About This Type

Enum type: RuntimeHoldReason.

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
14Preimage
17Registry
20SafeMode
29Contracts

SCALE Encoding

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

Examples

Preimage = Preimage(HoldReason)
0x0e<field0>
0e Variant index 14 = Preimage
field 0 field0: HoldReason
Registry = Registry(HoldReason)
0x11<field0>
11 Variant index 17 = Registry
field 0 field0: HoldReason
SafeMode = SafeMode(HoldReason)
0x14<field0>
14 Variant index 20 = SafeMode
field 0 field0: HoldReason

Code Examples

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

const registry = new TypeRegistry();

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

Referenced By (1)

Type Information

Type ID
413
Kind
Variant
Path
node_subtensor_runtime::RuntimeHoldReason
Runtime
v393