Skip to content

feat: add Package support in MockChainBuilder & NoteScript#2502

Open
lima-limon-inc wants to merge 1 commit into0xMiden:nextfrom
lambdaclass:fabrizioorsi/miden-testing-compiler
Open

feat: add Package support in MockChainBuilder & NoteScript#2502
lima-limon-inc wants to merge 1 commit into0xMiden:nextfrom
lambdaclass:fabrizioorsi/miden-testing-compiler

Conversation

@lima-limon-inc
Copy link
Contributor

@lima-limon-inc lima-limon-inc commented Feb 23, 2026

Closes 0xMiden/compiler#981

This PR adds a couple of functionalities to the miden-protocol's NoteScript and NoteBuilder mainly intended to ease interaction with the output (i.e. Packages) generated by the miden-compiler.

Changes:

  • Created NoteScript::from_package in order to replicate AccountComponent::from_package and ease creation from a Package directly.
  • Added NoteBuilder::source_code, in order to encapsulate the two possible ways to create a NoteScript: either by a Package (potentially obtained by the compiler) or a SourceManager + dynamic Librarys (the current way).
  • Added MockChainBuilder::add_existing_account_from_components in order to create an account from AccountComponents directly.

On the compiler's testing code side, I believe, with the addition of the Package in both NoteScript and NoteBuilder, we could remove several functions/structs from the compiler's test code, notably:

  • create_note_from_package can be replaced with NoteBuilder.package
  • NoteCreationConfig is also handled by NoteBuilder

This is followed up on: #2502

@lima-limon-inc lima-limon-inc force-pushed the fabrizioorsi/miden-testing-compiler branch 2 times, most recently from be26aeb to 4367f48 Compare February 23, 2026 21:14
@mmagician mmagician added the pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority label Feb 25, 2026
@lima-limon-inc lima-limon-inc force-pushed the fabrizioorsi/miden-testing-compiler branch 2 times, most recently from d243d94 to 663a203 Compare February 27, 2026 18:03
@lima-limon-inc lima-limon-inc force-pushed the fabrizioorsi/miden-testing-compiler branch 2 times, most recently from 99d6b6a to f1ace92 Compare March 12, 2026 19:06
@lima-limon-inc lima-limon-inc changed the title feat: refactor miden-testing's MockChain to be used in the compiler's integration's test feat: add Package support in MockChainBuilder & NoteScript Mar 12, 2026
@lima-limon-inc lima-limon-inc force-pushed the fabrizioorsi/miden-testing-compiler branch from f1ace92 to 9436ebd Compare March 12, 2026 19:22
Signed-off-by: Tomas Fabrizio Orsi <tomas.orsi@lambdaclass.com>
Suggested-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
Signed-off-by: Tomas Fabrizio Orsi <tomas.orsi@lambdaclass.com>
@lima-limon-inc lima-limon-inc force-pushed the fabrizioorsi/miden-testing-compiler branch from 9436ebd to b5ae084 Compare March 12, 2026 19:35
@lima-limon-inc lima-limon-inc marked this pull request as ready for review March 12, 2026 20:51
@PhilippGackstatter PhilippGackstatter self-requested a review March 16, 2026 08:03
@PhilippGackstatter
Copy link
Contributor

Hey @lima-limon-inc, I'll review the PR. Could you resolve the merge conflicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move the test suite helpers to Mockchain

3 participants