get_wasm_from_root

Function get_wasm_from_root 

Source
pub fn get_wasm_from_root(
    root: &[u8],
    max_wasm_size: u32,
    max_fragments: u8,
    enforce: bool,
    read_code: impl FnMut(Address) -> Result<Vec<u8>, StylusError>,
) -> Result<Vec<u8>, StylusError>
Expand description

Reconstruct the WASM of a root Stylus program: read each fragment’s deployed bytecode via read_code, strip its prefix, concatenate the compressed payloads, and decompress with the root’s dictionary. When enforce is set (i.e. activation), the decompressed-length and fragment-count limits are applied; reads otherwise only reconstruct the program.