Skip to content

Add the test that executes counter contract and note script on the testnet #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: next
Choose a base branch
from

Conversation

greenhat
Copy link
Contributor

@greenhat greenhat commented Jun 10, 2025

Close #554

This PR:

  • adds a new counter contract test executed against the Miden testnet using the client directly;

TODO:

greenhat added 5 commits June 6, 2025 08:47
The testnet integration test infrastructure was creating accounts without
storing their authentication keys in the keystore, causing signature
generation failures during transaction execution.

This commit:
- Adds a FilesystemKeyStore instance to the Scenario struct
- Passes the keystore to create_account function
- Stores the authentication key (RpoFalcon512) in the keystore before
  adding the account to the client
@greenhat
Copy link
Contributor Author

@bitwalker I've tried to use Scenario type for the counter_contract test on the testnet, and I stumbled on one lacking feature. When I want to get the note ID when I'm creating the output note so that I can use it later when consuming the note. I haven't figured out an ergonomic way to implement it with its builder-like API. So I temporarily wrote a new test using the Miden client directly.

Besides that, I've been thinking about the target audience for the testing harness, and I think it might be too opinionated for the end users. Meaning that they would have to familiarize themselves with Miden client API anyway when they will be writing their off-chain code. And now we are forcing them to also learn an opinionated framework to write their tests instead of just letting them use the already familiar Miden client API that they've used in their off-chain code.

@bitwalker
Copy link
Contributor

@greenhat To be clear, the testing harness in the integration test suite is for internal use only, the public test harness would almost certainly look different, and likely incorporate the efforts by the node and client teams in terms of describing test setup/scenarios.

If the Scenario type isn't achieving the goal of allowing us to declaratively express test scenarios at a high level, while hiding the boilerplate/details of the underlying client orchestration, then it isn't suited to its purpose, and I think it should be rewritten/refactored so that it does. I still think writing tests directly against the miden-client APIs in our integration test suite is far too low-level at this point in time, and is going to cause a lot of churn as that API evolves. Ideally we could keep that churn contained in a single place, more or less, but it really depends on if there are repeated patterns in the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run counter-contract and note example on the testnet
2 participants