pub fn image_cap(
image: &Image,
pinned_hashes: &[(Key, CapHash)],
initial_hashes: &[(Key, CapHash)],
) -> Result<ImageCap, ImageConvertError>Expand description
Build an ImageCap from the SSZ-encoded crate::image::Image
shape. The Data content referenced by pinned and initial slots must
already be published — pass the resolved (SlotIdx, CapHash) pairs
in pinned_hashes and initial_hashes. The builder sorts both lists
by slot index.
Lossy fields (intentionally dropped):
- per-endpoint
arg_registers: the calling convention is implicit in the new shape.gas_slotsandquota_slotsremain image metadata and are carried through unchanged.
Field mappings:
- Endpoints are stored in a sparse
Key -> EndpointDefmap (no fixed capacity).stack_topis extracted from the oldinitial_regs[1](RISC-V SP convention);arg_cnode_slotdefaults toKey::from(0). MemoryMapping.source(aSlotPath) is carried through verbatim; paths that are empty or deeper thanMAX_SOURCE_DEPTHerror.