OpenST / mosaic-contracts

Mosaic-0: Gateways and anchors on top of Ethereum to scale DApps
https://discuss.openst.org/c/mosaic
MIT License
114 stars 31 forks source link

Integration tests can access deployed contracts #624

Closed schemar closed 5 years ago

schemar commented 5 years ago

The main file is test_integration/main.sh as called from package.json.

Docker compose spawns two instances of geth, one for origin and one for auxiliary. It also tears them down after the tests.

In between the tests are run. integration_tests.js puts everything together (truffle and mocha) and executes the tests in the integration test directory.

Deployment is required to deploy the contracts and add them to the shared module.

The shared module is an object that stores data across tests. For example Web3 instances or TruffleContract instances.

Stake and mint is just an example.

As examples I added two Anchors and the two Gateways to this PR. Can be extended as required.

I had to use truffle exec in order to have access to artifacts.require.

Fixes #608