-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Rust-based tests #124
Labels
Comments
Merged
Merged
Done and closed by the last PR related to the initial infrastructure for Rust-based tests: #433 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
Currently, tests can be done in a rudimentary way by writing a script with hard-coded values, which calls ABI methods on contract. Tests can also be done by manually crafting input data into a script, which then calls ABI methods on a contract.
Both of these options are onerous to use for anything over than trivial tests. We'd like to support
This would allow arbitrary-complexity tests that can do things like make use of disk or network resources.
Proposal
Add a new commend to
forc
,forc test
, which runs one or more tests. Parameters can be based off ofcargo test
.The command should run the selected tests (written in Rust, in the project directory).
fuel-tx
can be used for craftingTransactionScript
transactions simply.A Rust SDK is needed that will:
Refer to https://github.com/FuelLabs/fuel-v2-contracts/blob/0cf8df2026a25ffef0719bf807586e736565aa2a/test/merkleTreeBinary.ts#L19 for a comprehensive example of the functionality tests should offer (except they should be written in Rust instead of TS/JS).
Additional repo that's a good reference for some features: https://github.com/gakonst/ethers-rs
The text was updated successfully, but these errors were encountered: