Skip to content
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

Transaction Tests #569

Merged
merged 1 commit into from
Nov 4, 2024
Merged

Conversation

dagarcia7
Copy link
Collaborator

Summary

This PR adds integration tests for the get_transactions and compile_tx_script web client calls in transactions.rs.

CHANGELOG.md Outdated
@@ -2,6 +2,7 @@

## 0.6.0 (TBD)

* Add Transaction Integration Tests for Web Client (#569).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use past tense in the changelog:

Suggested change
* Add Transaction Integration Tests for Web Client (#569).
* Added Transaction Integration Tests for Web Client (#569).

Comment on lines 50 to 53
let transactions = await client.get_transactions(window.TransactionFilter.all());
let uncomittedTransactions = await client.get_transactions(window.TransactionFilter.uncomitted());
let transactionIds = transactions.map(transaction => transaction.id().to_hex());
let uncomittedTransactionIds = uncomittedTransactions.map(transaction => transaction.id().to_hex());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we able to call getAllTransaction here? The one defined above

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we are! I also changed the "no transactions" test to just use that as well.

compileTxScript(script)
).to.be.rejectedWith(`Failed to compile transaction script: Transaction script error: AssemblyError("invalid syntax")`);
});
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

End of file is missing here

@dagarcia7 dagarcia7 force-pushed the transaction-tests branch 2 times, most recently from d9874db to 95842ea Compare November 1, 2024 20:58
@igamigo
Copy link
Collaborator

igamigo commented Nov 1, 2024

Once 0xPolygonMiden/miden-base#951 gets merged, the CI can be re-run since the WASM build should be fixed

@dagarcia7
Copy link
Collaborator Author

@igamigo sounds good thanks for the heads up! In the meantime, the rest of the feedback has been addressed @tomyrd @SantiagoPittella 🙌

@igamigo
Copy link
Collaborator

igamigo commented Nov 4, 2024

@dagarcia7 can you rebase your fork from next? It should contain fixes to your failing tests (as of #556).

@dagarcia7 dagarcia7 force-pushed the transaction-tests branch 3 times, most recently from e6b971f to 3570c3a Compare November 4, 2024 17:44
@dagarcia7
Copy link
Collaborator Author

@igamigo rebased and all looks good now! 🙌 Thanks!

Copy link
Collaborator

@tomyrd tomyrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for the changes.

Copy link
Collaborator

@igamigo igamigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Leaving one small comment

await new Promise((r) => setTimeout(r, 20000)); // TODO: Replace this with loop of sync -> check uncommitted transactions -> sleep
await client.sync_state();
if (_sync) {
await new Promise((r) => setTimeout(r, 20000)); // TODO: Replace this with loop of sync -> check uncommitted transactions -> sleep
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be very nice to address this with a function that the whole test suite can call, in order to minimize execution time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! This has been on my mind a lot as well. Let me merge in this PR, and will follow up with this immediately 🫡

@dagarcia7 dagarcia7 merged commit adbd708 into 0xPolygonMiden:next Nov 4, 2024
14 checks passed
@dagarcia7 dagarcia7 deleted the transaction-tests branch November 4, 2024 19:30
igamigo pushed a commit that referenced this pull request Nov 7, 2024
igamigo pushed a commit that referenced this pull request Nov 7, 2024
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.

4 participants