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

Tests #38

Open
LinuxIsCool opened this issue Nov 20, 2022 · 6 comments
Open

Tests #38

LinuxIsCool opened this issue Nov 20, 2022 · 6 comments

Comments

@LinuxIsCool
Copy link

There are no tests written for this library. That seems dangerous. I would be happy to start contributing tests. I'm still trying to get a sample running.

@gerrrg
Copy link
Collaborator

gerrrg commented Nov 21, 2022

Unit tests for balpy have been deprioritized since many of the test cases would involve deploying contracts to specific chains, which would clutter the testnet UIs, cost money on production networks, and require maintaining native asset balances on various chains. Not impossible, but pretty tedious.

Doing the tests locally would require integrating brownie which honestly would be amazing, but it would be a significant undertaking that I don't have time for right now

@LinuxIsCool
Copy link
Author

Do you think it could be done using ApeworkX instead of Brownie?

https://docs.apeworx.io/ape/stable/userguides/testing.html

I would be interested in making this kind of contribution to the repo.

@gerrrg
Copy link
Collaborator

gerrrg commented Nov 22, 2022

I've heard to ApeworkX but have never gone down the rabbit hole. If we were to move in that direction, we would definitely need to add all the bytecode and ABIs back in. I had previously removed them to make the package more lightweight

@LinuxIsCool
Copy link
Author

I think bytecode and ABIs could be gitignored. The package could stay as is, add ape-eth as a dependency, and compile contracts on the fly when running tests...

@pygeek
Copy link

pygeek commented Dec 10, 2022

@gerrrg Automated unit tests can be implemented by stubbing out external behaviors using pytest. I think it would be of value to test the internal logic of this library, not necessarily the smart contracts or other external behaviors.

@8ball030
Copy link

@LinuxIsCool

I have a nice stable env up and running here;

#55

We can use a local fork from a specific block for tests.

See this suite here;

https://github.com/8ball030/rysk_explorations/blob/5a83dabf0043c174bf553172acc7c7661069fc01/tests/test_contract_calls.py#L44

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

No branches or pull requests

4 participants