MCPcopy Create free account
hub / github.com/argumentcomputer/ix / apply_mdata

Function apply_mdata

crates/compile/src/decompile.rs:413–421  ·  view source on GitHub ↗

Wrap a LeanExpr in pre-decompiled mdata layers. The `lean_mdata` vec stores layers outermost-first. We iterate in reverse to wrap innermost-first: given [kv_outer, kv_inner], result is mdata(kv_outer, mdata(kv_inner, expr)).

(
  mut expr: LeanExpr,
  lean_mdata: Vec<Vec<(Name, LeanDataValue)>>,
)

Source from the content-addressed store, hash-verified

411}
412
413/// Read a Tag0-encoded u64 from a byte slice, advancing the cursor.
414fn read_tag0(buf: &mut &[u8]) -> Result<u64, DecompileError> {
415 Tag0::get(buf).map(|t| t.size).map_err(|_| {
416 DecompileError::BadConstantFormat {
417 msg: "read_tag0: unexpected EOF".into(),
418 }
419 })
420}
421
422/// Read exactly 32 bytes (Address) from a byte slice, advancing the cursor.
423fn read_addr_bytes(buf: &mut &[u8]) -> Result<Address, DecompileError> {
424 if buf.len() < 32 {

Callers 1

decompile_exprFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected