coordinape / coordinape-protocol

🏆 Coordinape contracts
MIT License
32 stars 12 forks source link

Brownie tests are failing #6

Closed Niraj-Kamdar closed 2 years ago

Niraj-Kamdar commented 2 years ago

brownie test are failing since the usdc contract isn’t deployed

@pytest.fixture()
def usdc(interface):
    return interface.IERC20('0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48')

Here’s error:

ERROR tests/test_ape_vaults.py::test_vault_creation - brownie.exceptions.ContractNotFound: No contract deployed at 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
ERROR tests/test_ape_vaults.py::test_router - brownie.exceptions.ContractNotFound: No contract deployed at 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
ERROR tests/test_ape_vaults.py::test_vault_exit - brownie.exceptions.ContractNotFound: No contract deployed at 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

Let me know if I am missing something while setting env up.

levity commented 2 years ago

is this on the main branch or feat/v1? all the active work is on the latter at the moment, so please make sure you're working off that

levity commented 2 years ago

we'll push everything back to master soon to simplify things

Niraj-Kamdar commented 2 years ago

Yes I am on feat/v1 branch

crabsinger commented 2 years ago

Hello @Niraj-Kamdar

I'm not sure if the test suite is supposed to be green on this branch, yet. @cesarsld can chime in more.

Niraj-Kamdar commented 2 years ago

This can be fixed by adding .env with WEB3_INFURA_PROJECT_ID=xyz and running brownie test with

brownie test --network mainnet-fork

Although this would require Infura API key with high rate limit or we need to selectively run tests one by one to not trigger rate limit.

I would recommend adding .env.sample in repo and the above command to run test in README

crabsinger commented 2 years ago

Ah yes, these are supposed to be forked from the latest block on mainnet.

Yes, I agree adding these commands and instructions to the README and a .env.example (we use example instead of sample in the other repos) would be great. Do you want to go ahead and create that PR and close this issue? @Niraj-Kamdar

Niraj-Kamdar commented 2 years ago

Yeah sure