Near-One / rainbow-bridge

🌈🌈🌈 NEAR <> Ethereum Decentralized Bridge
GNU General Public License v3.0
327 stars 100 forks source link

Cross contract tests for Solidity contracts #199

Open MaksymZavershynskyi opened 4 years ago

MaksymZavershynskyi commented 4 years ago

We need to test the following Solidity contracts: Near2EthClient, Near2EthProver, Locker, and their interaction with each other (and ERC20) by using mocks. Specifically we need to check for each interaction: the success case, and the failure case, e.g. we need to check for the Near2EthProver that it handles correctly both failure by Near2EthClient and success by Near2EthClient. Same thing with Token, when token interacts with ERC20 we need to test for failure to transfer, success to transfer; when it interacts with prover: failed proof, successful proof.

ailisp commented 4 years ago

To clarify, these are meant to be unit tests, because

their interaction with each other (and ERC20) by using mocks>

In detail:

we need to check for the Near2EthProver that it handles correctly both

Same thing with Token, when token interacts with ERC20 we need to test

when it interacts with prover:

So in short, we only need to mock contracts of three failure cases listed above.