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)>>, )
| 411 | } |
| 412 | |
| 413 | /// Read a Tag0-encoded u64 from a byte slice, advancing the cursor. |
| 414 | fn 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. |
| 423 | fn read_addr_bytes(buf: &mut &[u8]) -> Result<Address, DecompileError> { |
| 424 | if buf.len() < 32 { |