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

dev: test account_contract entrypoints #929

Open
enitrat opened this issue Sep 12, 2024 · 0 comments
Open

dev: test account_contract entrypoints #929

enitrat opened this issue Sep 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@enitrat
Copy link
Collaborator

enitrat commented Sep 12, 2024

  • Execute from outside is already tested in test_execute_from_outside.cairo

  • Some tests are already implemented in test_contract_account.cairo

  • Add tests for other entrypoints, using starknet-foudry.

  • Modify existing tests, avoiding contract deployment if possible. For example, to test the get_nonce / set_nonce entrypoints, I can use a combination of store / load and internal state of the contract; which is easier than deploying everything.
    Avoid deploying contracts if possible: for simple use cases, you should be able to use a combination of store, load, and internal testing using contract_state_for_testing.

see https://book.cairo-lang.org/ch17-02-testing-smart-contracts.html#accessing-internal-functions-with-contract_state_for_testing

@enitrat enitrat added the enhancement New feature or request label Sep 12, 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
Projects
Status: 🆕 Backlog
Development

No branches or pull requests

1 participant