pub fn image_cap(
image: &Image,
pinned_hashes: &[(SlotIdx, CapHash)],
initial_hashes: &[(SlotIdx, CapHash)],
) -> Result<ImageCap, ImageConvertError>Expand description
Build an ImageCap from the SCALE-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):
gas_slots/quota_slots: gas is now tracked onsuper::instance::InstanceCap::gas_remaining; the v3 cap shape no longer pins gas/quota slots in the Image.- per-endpoint
arg_registers: the calling convention is implicit in the new shape.
Field mappings:
- Endpoints are stored in a dense
MAX_ENDPOINTS-sized array, indexed by endpoint id. Empty slots useEndpointDef::empty.stack_topis extracted from the oldinitial_regs[1](RISC-V SP convention);arg_cnode_slotdefaults toSlotIdx(0). MemoryMapping.source: SlotPathbecomessource_path: [SlotIdx; MAX_SOURCE_DEPTH] + source_path_len; paths deeper than 8 error.