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.

57 lines
2.0 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. `npm i`
  9. Go to where the deployment scripts for the test are found:
  10. `cd scripts/ethclient-test-deployment`
  11. Now, a bash script has to be run to do the deployment:
  12. `./test-deployment`
  13. This bash file follows these steps:
  14. - `npx builder node`: a local blockchain to do our tests
  15. - `npx buidler run --network localhost test-deployment.js`: run the deployment on the local blockchain
  16. An output file necessary for the next step is obtained: `deploy-output`.
  17. > The files that find in `/eth/contracts` must be obtained from the same contract that we deploy in this step
  18. ## Ethclient Test
  19. Different environment variables are necessary to run this test.
  20. They must be taken from the output file of the previous step.
  21. They can be provided by file called `.env`:
  22. ```
  23. GENESIS_BLOCK=97
  24. AUCTION="0x038B86d9d8FAFdd0a02ebd1A476432877b0107C8"
  25. AUCTION_TEST="0xEcc0a6dbC0bb4D51E4F84A315a9e5B0438cAD4f0"
  26. TOKENHEZ="0xf4e77E5Da47AC3125140c470c71cBca77B5c638c"
  27. HERMEZ="0xD6C850aeBFDC46D7F4c207e445cC0d6B0919BDBe"
  28. WDELAYER="0x500D1d6A4c7D8Ae28240b47c8FCde034D827fD5e"
  29. WDELAYER_TEST="0x1d80315fac6aBd3EfeEbE97dEc44461ba7556160"
  30. ```
  31. > An example is found in `/etc/.env.example`
  32. And then run test:
  33. `INTEGRATION=1 go test`
  34. Or they can be provided as a parameter in the command that runs the test:
  35. `INTEGRATION=1 GENESIS_BLOCK=97 AUCTION="0x038B86d9d8FAFdd0a02ebd1A476432877b0107C8" AUCTION_TEST="0xEcc0a6dbC0bb4D51E4F84A315a9e5B0438cAD4f0" TOKENHEZ="0xf4e77E5Da47AC3125140c470c71cBca77B5c638c" HERMEZ="0xD6C850aeBFDC46D7F4c207e445cC0d6B0919BDBe" WDELAYER="0x500D1d6A4c7D8Ae28240b47c8FCde034D827fD5e" WDELAYER_TEST="0x1d80315fac6aBd3EfeEbE97dEc44461ba7556160" go test`