Expand description
Single-source data walker for descriptor ↔ RuntimeValue ↔
AlignedValue round trips.
The atom-flat descriptors (Boolean / Counter / Field / Uint / Bytes
/ Opaque / Vector / Tuple / Struct / Enum / Cell / Alias) are
covered by crate::ir::descriptor — bidirectional, fully
typed. This module re-exports those primitives under the walker
name and adds the storage-shape helpers (Map / Set / List /
MerkleTree / HistoricMerkleTree) that the descriptor module can’t
cover because they aren’t atom-flat.
Convention is the one crate::ir::descriptor::decode_aligned_value
uses across the codebase: Bytes<N> / Field /
Opaque<Uint8Array> decode into RuntimeValue::String(hex),
Counter / small Uint<…> into RuntimeValue::Int, big Uint<…>
into RuntimeValue::String(decimal), structs into objects keyed
by IR field name, enums into the variant-name string. Generated
code on every binding language (Rust, TypeScript via napi/wasm,
Swift/Python/etc via uniffi) projects from there into language-
idiomatic typed shapes.
Re-exports§
pub use crate::ir::descriptor::decode_aligned_value;pub use crate::ir::descriptor::decode_aligned_value_full;pub use crate::ir::descriptor::encode_bool;pub use crate::ir::descriptor::encode_bytes;pub use crate::ir::descriptor::encode_default;pub use crate::ir::descriptor::encode_field;pub use crate::ir::descriptor::encode_literal;pub use crate::ir::descriptor::encode_uint;pub use crate::ir::descriptor::json_as_u128;
Functions§
- aligned_
value_ from_ atoms - Build an
AlignedValuedirectly from a raw atom slice and an alignment singleton. Skips the round-trip when the caller already knows the descriptor and just needs to wrap raw atoms. - atom_
buffer_ to_ aligned - Reconstruct an
AlignedValuefrom anAtomBuffer(i.e. the shapecrate::ledgerproduces). Useful for callers that need to pass a ledger snapshot back intoencode_literalor any other surface that wantsAlignedValue. Alignment metadata is rebuilt fromdescriptorso the result matches what the encoder would have produced for the same logical value. - walk_
cell - Walk a
Cell<T>snapshot — typed by the inner descriptor. - walk_
counter - Walk a
Countersnapshot. Always 8-byte unsigned. - walk_
historic_ merkle_ tree - Walk a
HistoricMerkleTree<depth, T>snapshot into a{ live: MerkleTree, history: [MerkleTree] }object. - walk_
list - Walk a
List<T>snapshot. - walk_
map - Walk a
Map<K, V>snapshot. Keys are projected through the key descriptor and stringified for the resulting object’s keys; values project through the value descriptor (an empty atom buffer in the value slot becomesRuntimeValue::Null, matching the waySet<T>is on-chain encoded asMap<T, Null>). - walk_
merkle_ tree - Walk a
MerkleTree<depth, T>snapshot into a{ root: bytes, height: int }object — byte-honest. - walk_
set - Walk a
Set<T>snapshot.