Skip to content

Migrate helpers.rs to use protocol's from_package() methods #42

@Keinberger

Description

@Keinberger

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions