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

Improve testing of starknet_simulateTransactions #192

Open
FabijanC opened this issue Oct 5, 2023 · 3 comments
Open

Improve testing of starknet_simulateTransactions #192

FabijanC opened this issue Oct 5, 2023 · 3 comments
Labels
enhancement New feature or request Medium Task is of medium difficulty to fix OnlyDust testing Related to code testing

Comments

@FabijanC
Copy link
Contributor

FabijanC commented Oct 5, 2023

Tests in crates/starknet-devnet/tests/test_simulate_transactions.rs were written to have the same coverage as devnet-py the corresponding devnet-py tests. Currently there are TODOs:

  • Better testing of SKIP_FEE_CHARGE by using a greater than zero max_fee in several tests
  • Add testing of invoke tx simulation being reverted (could be done by using an invalid max_fee (checked: this leads to a Reverted case that is currently not tested))
    - Another test needs replacement of .ge with .gt (basically we would want to assert that using SKIP_VALIDATE actually lowers the estimated fee, but currently it does not have effect, as described in this issue: SKIP_VALIDATE not affecting fee in simulation lambdaclass/starknet_in_rust#1051)
    • This issue can be addressed separately as it would not merely be enhancement but fix
  • Use starknet.rs's .simulate(...) instead of manually constructing simulation requests.
@FabijanC FabijanC added the enhancement New feature or request label Oct 5, 2023
@FabijanC FabijanC self-assigned this Oct 5, 2023
@FabijanC FabijanC added the testing Related to code testing label Oct 5, 2023
@ivpavici ivpavici added OnlyDust ODHack Issue to assign for the ODHack event Medium Task is of medium difficulty to fix labels Apr 19, 2024
@joseSalazar4
Copy link

joseSalazar4 commented Apr 22, 2024

Hey there! This sounds like a good first issue to work on and try my rust skills! Could I get assigned to it? I also understand Python so checking out the devnet-py test will be easy.

@FabijanC
Copy link
Contributor Author

@joseSalazar4 you've been assigned

@FabijanC
Copy link
Contributor Author

Try adding two more tests:

  • one which simulates a tx that gets reverted (and asserting that this is what really happened) - find a way to make it revert, there might be some helpful clues in the TODOs
  • one which tests SKIP_FEE_CHARGE in conditions that haven't yet been tested in the file

If you feel the tests are too similar, then just add one.

In any case, feel free to create at least a draft PR even if you're not yet done (but indicating so). That way we can see exactly what you've done so far and make concrete suggestions.

@ivpavici ivpavici removed the ODHack Issue to assign for the ODHack event label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Medium Task is of medium difficulty to fix OnlyDust testing Related to code testing
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants