From 833ef70bbdf65de9a42e252a3991bd6c897298da Mon Sep 17 00:00:00 2001 From: Ermyas Abebe Date: Wed, 7 Feb 2024 17:01:06 +1100 Subject: [PATCH 1/2] Add example .env --- .env.example | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..9ef3e283 --- /dev/null +++ b/.env.example @@ -0,0 +1,8 @@ +WITHDRAWAL_DELAY=1 +DEPLOYMENTS=MAINNET,TESTNET +MAINNET_BRIDGE_ADDRESS=0xBa5E35E26Ae59c7aea6F029B68c6460De2d13eB6 +MAINNET_FLOW_RATED_TOKENS=0x0000000000000000000000000000000000000Eee,0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF,0xdAC17F958D2ee523a2206206994597C13D831ec7,0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599,0xccC8cb5229B0ac8069C51fd58367Fd1e622aFD97,0x9AB7bb7FdC60f4357ECFef43986818A2A3569c62 +MAINNET_RPC_URL= +TESTNET_RPC_URL= +TESTNET_FLOW_RATED_TOKENS=0x0000000000000000000000000000000000000Eee,0xe2629e08f4125d14e446660028bd98ee60ee69f2 +TESTNET_BRIDGE_ADDRESS=0x0D3C59c779Fd552C27b23F723E80246c840100F5 \ No newline at end of file From 0adf2b311d59c406328356a4a79e8ca820ff8166 Mon Sep 17 00:00:00 2001 From: Ermyas Abebe Date: Wed, 7 Feb 2024 17:12:24 +1100 Subject: [PATCH 2/2] Document details for running fork test --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c2c812d7..4ab5e90a 100644 --- a/README.md +++ b/README.md @@ -82,11 +82,28 @@ $ forge install $ forge build ``` -### Test +### Testing +To run all tests (unit, integration, and fork tests), run the following command: +```shell +$ forge test +``` +This requires setting the relevant environment variables as described in the "Fork Test" section below. + +**Unit and Integration Tests Only** ```shell $ forge test --no-match-path "test/fork/**" ``` +**Fork Tests Only** + +The fork tests run a suite of tests against one or more deployments of the bridge. +To run these tests copy [`.env.example`](.env.example) file to a `.env` file and set the `MAINNET_RPC_URL` and `TESTNET_RPC_URL` environment variables. Set or update any other environment variables as required. +Then run the following command to run the fork tests. + +```shell +$ forge test --match-path "test/fork/**" +``` + ## Contract Deployment ### Local Deployment To set up the contracts on two separate local networks, we need to start running the local networks, then deploy and initialize the contracts.