The helpers in integration/src/helpers.rs manually reimplement functionality that now exists natively in miden-protocol on the next branch:
account_component_from_package() manually extracts metadata sections and calls AccountComponent::new() with raw storage slots. This is replaced by AccountComponent::from_package(&package, &init_storage_data) which handles metadata extraction and storage initialization internally.
create_note_from_package() manually calls package.unwrap_program() and NoteScript::from_parts(). This is replaced by NoteScript::from_package(&package) which uses the @note_script attribute to find the entrypoint.
- Note assembly can be simplified using
NoteBuilder::package() from miden-standards::testing.
Once we upgrade to v0.14/v0.15 protocol dependencies, we should replace the local helpers with these protocol methods. This will also simplify AccountCreationConfig (can drop storage_slots and supported_types fields since from_package() handles those via package metadata).
Related: protocol#2689
The helpers in
integration/src/helpers.rsmanually reimplement functionality that now exists natively inmiden-protocolon thenextbranch:account_component_from_package()manually extracts metadata sections and callsAccountComponent::new()with raw storage slots. This is replaced byAccountComponent::from_package(&package, &init_storage_data)which handles metadata extraction and storage initialization internally.create_note_from_package()manually callspackage.unwrap_program()andNoteScript::from_parts(). This is replaced byNoteScript::from_package(&package)which uses the@note_scriptattribute to find the entrypoint.NoteBuilder::package()frommiden-standards::testing.Once we upgrade to v0.14/v0.15 protocol dependencies, we should replace the local helpers with these protocol methods. This will also simplify
AccountCreationConfig(can dropstorage_slotsandsupported_typesfields sincefrom_package()handles those via package metadata).Related: protocol#2689