You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.1 KiB

  1. Test Ethclient - Contracts
  2. ## Contracts
  3. The first step is to clone the github repository where the contracts are located:
  4. `git clone https://github.com/hermeznetwork/contracts.git`
  5. While the prepared deployment is not found to master, branch in repository must be changed:
  6. `git checkout feature/ethclient-test-deployment`
  7. Now, install the dependencies:
  8. ```
  9. cd contracts/
  10. yarn install
  11. ```
  12. Go to where the deployment scripts for the test are found:
  13. `cd scripts/ethclient-deployment/`
  14. Now, a bash script (which uses gnome-terminal) has to be run to do the deployment:
  15. `./test-deploy.sh`
  16. This bash file follows these steps:
  17. - `npx builder node`: a local blockchain to do our tests
  18. - `npx buidler run --network localhost test-deployment.js`: run the deployment on the local blockchain
  19. Alternatively you can run the two previous commands manually in different terminals.
  20. An output file necessary for the next step is obtained: `deploy-output`.
  21. > The files that appear in `hermez-node/eth/contracts` must be generated from the same contract that we deploy in this step
  22. ## Ethclient Test
  23. Different environment variables are necessary to run this test.
  24. They must be taken from the output file of the previous step.
  25. They can be provided by file called `.env`:
  26. ```
  27. GENESIS_BLOCK=97
  28. AUCTION="0x038B86d9d8FAFdd0a02ebd1A476432877b0107C8"
  29. AUCTION_TEST="0xEcc0a6dbC0bb4D51E4F84A315a9e5B0438cAD4f0"
  30. TOKENHEZ="0xf4e77E5Da47AC3125140c470c71cBca77B5c638c"
  31. HERMEZ="0xD6C850aeBFDC46D7F4c207e445cC0d6B0919BDBe"
  32. WDELAYER="0x500D1d6A4c7D8Ae28240b47c8FCde034D827fD5e"
  33. WDELAYER_TEST="0x1d80315fac6aBd3EfeEbE97dEc44461ba7556160"
  34. ```
  35. > An example is found in `hermez-node/eth/.env.example`
  36. And then run test from `hermez-node/eth/`:
  37. `INTEGRATION=1 go test`
  38. Or they can be provided as a parameter in the command that runs the test:
  39. `INTEGRATION=1 GENESIS_BLOCK=97 AUCTION="0x038B86d9d8FAFdd0a02ebd1A476432877b0107C8" AUCTION_TEST="0xEcc0a6dbC0bb4D51E4F84A315a9e5B0438cAD4f0" TOKENHEZ="0xf4e77E5Da47AC3125140c470c71cBca77B5c638c" HERMEZ="0xD6C850aeBFDC46D7F4c207e445cC0d6B0919BDBe" WDELAYER="0x500D1d6A4c7D8Ae28240b47c8FCde034D827fD5e" WDELAYER_TEST="0x1d80315fac6aBd3EfeEbE97dEc44461ba7556160" go test`