0xMiden / 0xMiden/project-template
Migrate helpers.rs to use protocol's from_package() methods
- Vorherrschende Sprache
- Rust
- Sterne
- 0
- Forks
- 10
- Ø Merge
- 8 T. 16 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
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](https://github.com/0xMiden/protocol/issues/2689)
Beitragsleitfaden
Rechercherichtung
The work is in integration/src/helpers.rs. Look at the functions account_component_from_package and create_note_from_package. Compare them to the from_package methods in the miden-protocol crate on the next branch. Update the helpers to call AccountComponent::from_package and NoteScript::from_package. Also check AccountCreationConfig to remove storage_slots and supported_types fields. Run the integration tests to ensure the refactor works.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust
- Bereich
- backend, tooling
- Issue-Typ
- Refactoring
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 55/100