Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smr 2459 invariant testing #89

Merged
merged 33 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b0d64a1
Fix crash
wcgcyx Feb 20, 2024
85a58df
Fix
wcgcyx Feb 20, 2024
f7baef0
Update InvariantBridge.t.sol
wcgcyx Feb 20, 2024
ccf95ab
Update
wcgcyx Feb 21, 2024
de5977f
Update MockAdaptor.sol
wcgcyx Feb 21, 2024
c2f8e47
Update InvariantBridge.t.sol
wcgcyx Feb 21, 2024
86a629f
Fmt
wcgcyx Feb 21, 2024
9178788
Create resetchain.config.ts
wcgcyx Feb 21, 2024
8081872
Update
wcgcyx Feb 21, 2024
087864f
Update test.yml
wcgcyx Feb 21, 2024
8255782
Update InvariantBridge.t.sol
wcgcyx Feb 21, 2024
da6dcf3
Update InvariantBridge.t.sol
wcgcyx Feb 21, 2024
32e49ed
Update InvariantBridge.t.sol
wcgcyx Feb 21, 2024
fcfc463
Update InvariantBridge.t.sol
wcgcyx Feb 21, 2024
1a36766
Update InvariantBridge.t.sol
wcgcyx Feb 21, 2024
f49b8f9
Update InvariantBridge.t.sol
wcgcyx Feb 21, 2024
5d54819
Withdraw/Deposit
wcgcyx Feb 26, 2024
62e5bc9
Update InvariantBridge.t.sol
wcgcyx Feb 26, 2024
b77a482
Add helper methods
wcgcyx Feb 27, 2024
dde7380
Update
wcgcyx Feb 27, 2024
a5c4fb5
Update InvariantBridge.t.sol
wcgcyx Feb 27, 2024
1784c91
Update RootERC20BridgeFlowRateHandler.sol
wcgcyx Feb 27, 2024
5a47e0f
Simplify testing scenario
wcgcyx Feb 27, 2024
96a9009
Update
wcgcyx Feb 27, 2024
cc7342f
Update InvariantBridge.t.sol
wcgcyx Feb 27, 2024
2348071
Update InvariantBridge.t.sol
wcgcyx Feb 27, 2024
83e4f85
Add tests
wcgcyx Feb 27, 2024
d30fdc7
Add tests
wcgcyx Feb 27, 2024
8a55ab8
Update InvariantBridge.t.sol
wcgcyx Feb 28, 2024
ea7943f
Cleanup unnecessary code
wcgcyx Mar 1, 2024
23b96bf
Update InvariantBridge.t.sol
wcgcyx Mar 6, 2024
7071c46
Cleanup
wcgcyx Mar 6, 2024
d731c78
Cleanup
wcgcyx Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
with:
submodules: recursive

- name: Set Node.js 18.18.x
uses: actions/setup-node@v3
with:
node-version: 18.18.x

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
Expand All @@ -35,12 +40,38 @@ jobs:
forge build --sizes
id: build

- name: Run unit and integration tests
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install

- name: Run build
uses: borales/actions-yarn@v4
with:
cmd: build

- name: Run Unit Tests
run: |
forge test --no-match-path "test/fork/**" -vvv
id: unit_integration_test
forge test --match-path "test/unit/**" -vvv
id: unit_test

- name: Run Integration Tests
run: |
forge test --match-path "test/integration/**" -vvv
id: integration_test

- name: Run Fuzz Tests
run: |
forge test --match-path "test/fuzz/**" -vvv
id: fuzz_test

- name: Run Fork Tests
run: |
forge test --match-path "test/fork/**" -vvvvv
id: fork_test

- name: Run Invariant Tests
run: |
yarn local:testchain
forge test --match-path "test/invariant/**" -vvvvv
id: invariant_test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"local:ci": "cd scripts/localdev; rm -rf .child.bridge.contracts.json .root.bridge.contracts.json; ./ci.sh && ./deploy.sh && AXELAR_API_URL=skip npx mocha --require mocha-suppress-logs ../e2e/e2e.ts && ./stop.sh",
"local:chainonly": "cd scripts/localdev; LOCAL_CHAIN_ONLY=true ./start.sh",
"local:axelaronly": "cd scripts/localdev; npx ts-node axelar_setup.ts",
"local:testchain": "cd scripts/localdev; ./chains.sh",
"stop": "cd scripts/localdev; ./stop.sh"
},
"author": "",
Expand Down
10 changes: 10 additions & 0 deletions scripts/localdev/chains.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -ex
set -o pipefail

# Stop previous deployment.
./stop.sh

# Start root & child chain.
npx hardhat node --config ./rootchain.config.ts --port 8500 > /dev/null 2>&1 &
sleep 10
21 changes: 21 additions & 0 deletions scripts/localdev/resetchain.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";

const config: HardhatUserConfig = {
networks: {
hardhat: {
hardfork: "shanghai",
mining: {
auto: false,
interval: 1200
},
chainId: 2502,
accounts: [],
},
localhost: {
url: "http://127.0.0.1:8502/",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this required?

}
},
solidity: "0.8.19",
};
export default config;
Loading
Loading