From 11c941fbf58513b3c98b7a1c2c19888c0fdff221 Mon Sep 17 00:00:00 2001 From: Dean Amiel Date: Thu, 26 Oct 2023 00:56:05 -0400 Subject: [PATCH 01/13] feat: integration test GH action --- .github/workflows/integration-test.yaml | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/integration-test.yaml diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml new file mode 100644 index 00000000..bc4c2992 --- /dev/null +++ b/.github/workflows/integration-test.yaml @@ -0,0 +1,55 @@ +name: Contract Deployments Integration Test + +on: pull_request + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-22.04] + arch: [amd64] + steps: + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install + run: npm ci + + - name: Spin up Hardhat Network + run: npx hardhat node & + + - name: Prepare local.json + run: | + echo '{ + "chains": { + "ethereum": { + "name": "Hardhat", + "id": "hardhat", + "chainId": 31337, + "rpc": "http://127.0.0.1:8545", + "tokenSymbol": "ETH", + "contracts": {} + } + } + }' > axelar-chains-config/info/local.json + + - name: Display local.json + run: cat axelar-chains-config/info/local.json + + - name: Deploy constAddressDeployer + run: node evm/deploy-contract.js -e local -a ./node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -n hardhat -m create -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + + - name: Deploy Create3Deployer + run: node evm/deploy-contract.js -e local -a ./node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -n hardhat -m create2 -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + + - name: Deploy AxelarGateway + run: node evm/deploy-gateway-v6.2.x.js -e local -n ethereum -m create3 -s "AxelarGateway v6.2" -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -g 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -m 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --keyID 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + + - name: Call Method on Gateway + run: node evm/gateway.js -e local -n ethereum --action callContract -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --destinationChain fantom From bc6d074593f40506ad86eeb3b61d96a06581a921 Mon Sep 17 00:00:00 2001 From: Dean Amiel Date: Thu, 26 Oct 2023 01:19:40 -0400 Subject: [PATCH 02/13] feat: check file structure --- .github/workflows/integration-test.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index bc4c2992..23af8143 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -21,6 +21,14 @@ jobs: - name: Install run: npm ci + - name: List directories and check file existence + run: | + echo "Listing all directories:" + ls -R # Lists all contents recursively in the working directory + + echo "Checking if 'local.json' exists in 'axelar-chains-config/info/':" + [ -f axelar-chains-config/info/local.json ] && echo "File exists" || echo "File does not exist" + - name: Spin up Hardhat Network run: npx hardhat node & From e2ea3118dbd7910f56e16f300a2abd7cdb7fe5d8 Mon Sep 17 00:00:00 2001 From: Dean Amiel Date: Thu, 26 Oct 2023 11:16:45 -0400 Subject: [PATCH 03/13] fix: chain name --- .github/workflows/integration-test.yaml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 23af8143..d09846a9 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -21,14 +21,6 @@ jobs: - name: Install run: npm ci - - name: List directories and check file existence - run: | - echo "Listing all directories:" - ls -R # Lists all contents recursively in the working directory - - echo "Checking if 'local.json' exists in 'axelar-chains-config/info/':" - [ -f axelar-chains-config/info/local.json ] && echo "File exists" || echo "File does not exist" - - name: Spin up Hardhat Network run: npx hardhat node & @@ -51,10 +43,10 @@ jobs: run: cat axelar-chains-config/info/local.json - name: Deploy constAddressDeployer - run: node evm/deploy-contract.js -e local -a ./node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -n hardhat -m create -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + run: node evm/deploy-contract.js -e local -a ./node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -n ethereum -m create -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - name: Deploy Create3Deployer - run: node evm/deploy-contract.js -e local -a ./node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -n hardhat -m create2 -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + run: node evm/deploy-contract.js -e local -a ./node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -n ethereum -m create2 -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - name: Deploy AxelarGateway run: node evm/deploy-gateway-v6.2.x.js -e local -n ethereum -m create3 -s "AxelarGateway v6.2" -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -g 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -m 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --keyID 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 From 2c0a9d03382b48d051c301830167c800fd3eeb5b Mon Sep 17 00:00:00 2001 From: Dean Amiel Date: Thu, 26 Oct 2023 11:21:38 -0400 Subject: [PATCH 04/13] fix: artifacts path --- .github/workflows/integration-test.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index d09846a9..91fe6602 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -42,11 +42,14 @@ jobs: - name: Display local.json run: cat axelar-chains-config/info/local.json + - name: Print working directory + run: pwd + - name: Deploy constAddressDeployer - run: node evm/deploy-contract.js -e local -a ./node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -n ethereum -m create -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + run: node evm/deploy-contract.js -e local -a @axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -n ethereum -m create -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - name: Deploy Create3Deployer - run: node evm/deploy-contract.js -e local -a ./node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -n ethereum -m create2 -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + run: node evm/deploy-contract.js -e local -a @axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -n ethereum -m create2 -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - name: Deploy AxelarGateway run: node evm/deploy-gateway-v6.2.x.js -e local -n ethereum -m create3 -s "AxelarGateway v6.2" -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -g 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -m 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --keyID 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 From e6fb60db9760ad97a36c936e3bc0e59ee55dcf7b Mon Sep 17 00:00:00 2001 From: Dean Amiel Date: Thu, 26 Oct 2023 11:27:11 -0400 Subject: [PATCH 05/13] fix: artifacts path --- .github/workflows/integration-test.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 91fe6602..d53b2e07 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -42,14 +42,11 @@ jobs: - name: Display local.json run: cat axelar-chains-config/info/local.json - - name: Print working directory - run: pwd - - name: Deploy constAddressDeployer - run: node evm/deploy-contract.js -e local -a @axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -n ethereum -m create -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + run: node evm/deploy-contract.js -e local -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -n ethereum -m create -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - name: Deploy Create3Deployer - run: node evm/deploy-contract.js -e local -a @axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -n ethereum -m create2 -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + run: node evm/deploy-contract.js -e local -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -n ethereum -m create2 -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - name: Deploy AxelarGateway run: node evm/deploy-gateway-v6.2.x.js -e local -n ethereum -m create3 -s "AxelarGateway v6.2" -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -g 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -m 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --keyID 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 From 6c702a12cc0454387d7d5486164c461e8349d50b Mon Sep 17 00:00:00 2001 From: Dean Amiel Date: Thu, 26 Oct 2023 11:31:56 -0400 Subject: [PATCH 06/13] fix: skip deployment prompt verification --- .github/workflows/integration-test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index d53b2e07..63facb90 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -43,13 +43,13 @@ jobs: run: cat axelar-chains-config/info/local.json - name: Deploy constAddressDeployer - run: node evm/deploy-contract.js -e local -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -n ethereum -m create -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + run: node evm/deploy-contract.js -e local -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -n ethereum -m create -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --yes - name: Deploy Create3Deployer - run: node evm/deploy-contract.js -e local -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -n ethereum -m create2 -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + run: node evm/deploy-contract.js -e local -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -n ethereum -m create2 -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --yes - name: Deploy AxelarGateway - run: node evm/deploy-gateway-v6.2.x.js -e local -n ethereum -m create3 -s "AxelarGateway v6.2" -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -g 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -m 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --keyID 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + run: node evm/deploy-gateway-v6.2.x.js -e local -n ethereum -m create3 -s "AxelarGateway v6.2" -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -g 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -m 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --keyID 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --yes - name: Call Method on Gateway - run: node evm/gateway.js -e local -n ethereum --action callContract -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --destinationChain fantom + run: node evm/gateway.js -e local -n ethereum --action callContract -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --destinationChain fantom --yes From 71455990d51bfd30f755fed43c8aade14b685226 Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Sat, 28 Oct 2023 22:35:22 -0400 Subject: [PATCH 07/13] add yaml to prettier --- .github/workflows/integration-test.yaml | 55 -------------------- .github/workflows/publish-chains-config.yaml | 36 ++++++------- .github/workflows/test-chains-config.yaml | 38 +++++++------- .github/workflows/test.yaml | 55 ++++++++++++++++++++ .prettierrc | 6 +++ package.json | 2 +- 6 files changed, 99 insertions(+), 93 deletions(-) delete mode 100644 .github/workflows/integration-test.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml deleted file mode 100644 index 63facb90..00000000 --- a/.github/workflows/integration-test.yaml +++ /dev/null @@ -1,55 +0,0 @@ -name: Contract Deployments Integration Test - -on: pull_request - -jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-22.04] - arch: [amd64] - steps: - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18 - - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install - run: npm ci - - - name: Spin up Hardhat Network - run: npx hardhat node & - - - name: Prepare local.json - run: | - echo '{ - "chains": { - "ethereum": { - "name": "Hardhat", - "id": "hardhat", - "chainId": 31337, - "rpc": "http://127.0.0.1:8545", - "tokenSymbol": "ETH", - "contracts": {} - } - } - }' > axelar-chains-config/info/local.json - - - name: Display local.json - run: cat axelar-chains-config/info/local.json - - - name: Deploy constAddressDeployer - run: node evm/deploy-contract.js -e local -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -n ethereum -m create -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --yes - - - name: Deploy Create3Deployer - run: node evm/deploy-contract.js -e local -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -n ethereum -m create2 -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --yes - - - name: Deploy AxelarGateway - run: node evm/deploy-gateway-v6.2.x.js -e local -n ethereum -m create3 -s "AxelarGateway v6.2" -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -g 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -m 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --keyID 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --yes - - - name: Call Method on Gateway - run: node evm/gateway.js -e local -n ethereum --action callContract -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --destinationChain fantom --yes diff --git a/.github/workflows/publish-chains-config.yaml b/.github/workflows/publish-chains-config.yaml index 962fb44f..aad53365 100644 --- a/.github/workflows/publish-chains-config.yaml +++ b/.github/workflows/publish-chains-config.yaml @@ -1,23 +1,23 @@ name: 'Publish Axelar Chains Config to NPM' on: - workflow_dispatch: + workflow_dispatch: jobs: - publish-to-npm: - name: 'Publish to NPM' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.x' - registry-url: 'https://registry.npmjs.org' - - run: npm ci - working-directory: ./axelar-chains-config - - run: npm run build - working-directory: ./axelar-chains-config - - run: npm publish - working-directory: ./axelar-chains-config - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + publish-to-npm: + name: 'Publish to NPM' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + working-directory: ./axelar-chains-config + - run: npm run build + working-directory: ./axelar-chains-config + - run: npm publish + working-directory: ./axelar-chains-config + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test-chains-config.yaml b/.github/workflows/test-chains-config.yaml index 7853f41b..b8a724be 100644 --- a/.github/workflows/test-chains-config.yaml +++ b/.github/workflows/test-chains-config.yaml @@ -3,25 +3,25 @@ name: Run Axelar Chains Config Tests on: pull_request jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-22.04] - arch: [amd64] - steps: - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18 + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-22.04] + arch: [amd64] + steps: + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 - - name: Checkout code - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 - - name: Install - run: npm ci - working-directory: axelar-chains-config + - name: Install + run: npm ci + working-directory: axelar-chains-config - - name: Test - run: npm run test - working-directory: axelar-chains-config + - name: Test + run: npm run test + working-directory: axelar-chains-config diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..628cfe6a --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,55 @@ +name: Contract Deployments Integration Test + +on: pull_request + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-22.04] + arch: [amd64] + steps: + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install + run: npm ci + + - name: Spin up Hardhat Network + run: npx hardhat node & + + - name: Prepare local.json + run: | + echo '{ + "chains": { + "ethereum": { + "name": "Hardhat", + "id": "hardhat", + "chainId": 31337, + "rpc": "http://127.0.0.1:8545", + "tokenSymbol": "ETH", + "contracts": {} + } + } + }' > axelar-chains-config/info/local.json + + - name: Display local.json + run: cat axelar-chains-config/info/local.json + + - name: Deploy constAddressDeployer + run: node evm/deploy-contract.js -e local -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -n ethereum -m create -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --yes + + - name: Deploy Create3Deployer + run: node evm/deploy-contract.js -e local -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -n ethereum -m create2 -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --yes + + - name: Deploy AxelarGateway + run: node evm/deploy-gateway-v6.2.x.js -e local -n ethereum -m create3 -s "AxelarGateway v6.2" -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -g 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -m 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --keyID 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --yes + + - name: Call Method on Gateway + run: node evm/gateway.js -e local -n ethereum --action callContract -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --destinationChain fantom --yes diff --git a/.prettierrc b/.prettierrc index a775ca18..a2194d80 100644 --- a/.prettierrc +++ b/.prettierrc @@ -22,6 +22,12 @@ "options": { "tabWidth": 2 } + }, + { + "files": "*.yaml", + "options": { + "tabWidth": 2 + } } ] } diff --git a/package.json b/package.json index ae82c3c9..8aecd090 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "lint": "eslint '**/*.js'", - "prettier": "prettier --write '**/*.js' 'axelar-chains-config/info/*.json' 'package.json' 'evm/**/*.json'" + "prettier": "prettier --write '**/*.js' 'axelar-chains-config/info/*.json' 'package.json' 'evm/**/*.json' '.github/**/*.yaml'" }, "repository": { "type": "git", From 6b5a979a64981f834fccb326b224cb5852c471c1 Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Sat, 28 Oct 2023 22:51:12 -0400 Subject: [PATCH 08/13] cleanup other files --- .github/workflows/lint.yaml | 5 ++--- .github/workflows/publish-chains-config.yaml | 2 +- .github/workflows/test-chains-config.yaml | 12 +++++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 3b700a32..8ceb6a8e 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,7 +1,6 @@ name: Linting -on: - - pull_request +on: pull_request jobs: lint: @@ -13,7 +12,7 @@ jobs: - ubuntu-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/publish-chains-config.yaml b/.github/workflows/publish-chains-config.yaml index aad53365..4613ab6a 100644 --- a/.github/workflows/publish-chains-config.yaml +++ b/.github/workflows/publish-chains-config.yaml @@ -8,7 +8,7 @@ jobs: name: 'Publish to NPM' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: '18.x' diff --git a/.github/workflows/test-chains-config.yaml b/.github/workflows/test-chains-config.yaml index b8a724be..5957734b 100644 --- a/.github/workflows/test-chains-config.yaml +++ b/.github/workflows/test-chains-config.yaml @@ -4,19 +4,21 @@ on: pull_request jobs: test: - runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04] - arch: [amd64] + node-version: + - 18.x + os: + - ubuntu-latest + runs-on: ${{ matrix.os }} steps: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 18 + node-version: ${{ matrix.node-version }} - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install run: npm ci From d84fc1a3c4e51fbcc90f61e54c2fe2488e475cb3 Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Sat, 28 Oct 2023 22:51:19 -0400 Subject: [PATCH 09/13] address comments --- .github/workflows/test.yaml | 41 ++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 628cfe6a..e7faecae 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,22 +1,24 @@ -name: Contract Deployments Integration Test +name: Test on: pull_request jobs: test: - runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04] - arch: [amd64] + node-version: + - 18.x + os: + - ubuntu-latest + runs-on: ${{ matrix.os }} steps: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 18 + node-version: ${{ matrix.node-version }} - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install run: npm ci @@ -28,28 +30,33 @@ jobs: run: | echo '{ "chains": { - "ethereum": { - "name": "Hardhat", - "id": "hardhat", + "test": { + "name": "Test", + "id": "test", "chainId": 31337, "rpc": "http://127.0.0.1:8545", - "tokenSymbol": "ETH", + "tokenSymbol": "TEST", "contracts": {} } } - }' > axelar-chains-config/info/local.json + }' > ./axelar-chains-config/info/local.json + + # Create .env file with default hardhat private key that's prefunded + - name: Prepare .env + run: | + echo "PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80\nENV=local\nCHAIN=test\n" > .env - name: Display local.json - run: cat axelar-chains-config/info/local.json + run: cat ./axelar-chains-config/info/local.json - - name: Deploy constAddressDeployer - run: node evm/deploy-contract.js -e local -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -n ethereum -m create -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --yes + - name: Deploy ConstAddressDeployer + run: node evm/deploy-contract.js -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c ConstAddressDeployer -m create -y - name: Deploy Create3Deployer - run: node evm/deploy-contract.js -e local -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -n ethereum -m create2 -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --yes + run: node evm/deploy-contract.js -a ../node_modules/@axelar-network/axelar-gmp-sdk-solidity/artifacts/contracts/deploy/ -c Create3Deployer -m create2 -y - name: Deploy AxelarGateway - run: node evm/deploy-gateway-v6.2.x.js -e local -n ethereum -m create3 -s "AxelarGateway v6.2" -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -g 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -m 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --keyID 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --yes + run: node evm/deploy-gateway-v6.2.x.js -m create3 -s "AxelarGateway v6.2" -g 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -m 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --keyID 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -y - name: Call Method on Gateway - run: node evm/gateway.js -e local -n ethereum --action callContract -p 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --destinationChain fantom --yes + run: node evm/gateway.js --action callContract --destinationChain test2 -y From b827288aa95cb82d1e3f5ef73e26e76edea9d0cc Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Sat, 28 Oct 2023 22:53:39 -0400 Subject: [PATCH 10/13] add chains env var --- evm/deploy-contract.js | 2 +- evm/gateway.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/evm/deploy-contract.js b/evm/deploy-contract.js index 993974b5..95d9bcd6 100644 --- a/evm/deploy-contract.js +++ b/evm/deploy-contract.js @@ -349,7 +349,7 @@ program.addOption( ); program.addOption(new Option('-a, --artifactPath ', 'artifact path').makeOptionMandatory(true)); program.addOption(new Option('-c, --contractName ', 'contract name').makeOptionMandatory(true)); -program.addOption(new Option('-n, --chainNames ', 'chain names').makeOptionMandatory(true)); +program.addOption(new Option('-n, --chainNames ', 'chain names').env('CHAINS').makeOptionMandatory(true)); program.addOption(new Option('--skipChains ', 'chains to skip over')); program.addOption( new Option('-m, --deployMethod ', 'deployment method').choices(['create', 'create2', 'create3']).default('create2'), diff --git a/evm/gateway.js b/evm/gateway.js index edac25c4..ec4a68f8 100644 --- a/evm/gateway.js +++ b/evm/gateway.js @@ -339,7 +339,7 @@ program.addOption( ); program.addOption(new Option('-c, --contractName ', 'contract name').default('Multisig')); program.addOption(new Option('-a, --address
', 'override address')); -program.addOption(new Option('-n, --chainNames ', 'chain names').makeOptionMandatory(true)); +program.addOption(new Option('-n, --chainNames ', 'chain names').makeOptionMandatory(true).env('CHAINS')); program.addOption(new Option('--skipChains ', 'chains to skip over')); program.addOption( new Option('--action ', 'gateway action') From b61febf323f26c963ce9a7456cb3d67e241a083e Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Sat, 28 Oct 2023 22:53:57 -0400 Subject: [PATCH 11/13] update gh action --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e7faecae..1d2ca299 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -44,7 +44,7 @@ jobs: # Create .env file with default hardhat private key that's prefunded - name: Prepare .env run: | - echo "PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80\nENV=local\nCHAIN=test\n" > .env + echo "PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80\nENV=local\nCHAINS=test\n" > .env - name: Display local.json run: cat ./axelar-chains-config/info/local.json From 71012cfb16b2dccaa3141d484171421432d2a019 Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Sat, 28 Oct 2023 22:57:01 -0400 Subject: [PATCH 12/13] move env --- evm/deploy-contract.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evm/deploy-contract.js b/evm/deploy-contract.js index 95d9bcd6..d03c77b7 100644 --- a/evm/deploy-contract.js +++ b/evm/deploy-contract.js @@ -349,7 +349,7 @@ program.addOption( ); program.addOption(new Option('-a, --artifactPath ', 'artifact path').makeOptionMandatory(true)); program.addOption(new Option('-c, --contractName ', 'contract name').makeOptionMandatory(true)); -program.addOption(new Option('-n, --chainNames ', 'chain names').env('CHAINS').makeOptionMandatory(true)); +program.addOption(new Option('-n, --chainNames ', 'chain names').makeOptionMandatory(true).env('CHAINS')); program.addOption(new Option('--skipChains ', 'chains to skip over')); program.addOption( new Option('-m, --deployMethod ', 'deployment method').choices(['create', 'create2', 'create3']).default('create2'), From 2dec24e395a78ad24df15fdfeee803b89a19d58e Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Sat, 28 Oct 2023 23:02:36 -0400 Subject: [PATCH 13/13] refactor --- .github/workflows/test.yaml | 4 +++- evm/balances.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1d2ca299..676f7896 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -44,7 +44,9 @@ jobs: # Create .env file with default hardhat private key that's prefunded - name: Prepare .env run: | - echo "PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80\nENV=local\nCHAINS=test\n" > .env + echo 'PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' >> .env + echo 'ENV=local' >> .env + echo 'CHAINS=test' >> .env - name: Display local.json run: cat ./axelar-chains-config/info/local.json diff --git a/evm/balances.js b/evm/balances.js index 0728fe0a..c02b0ce9 100644 --- a/evm/balances.js +++ b/evm/balances.js @@ -33,7 +33,7 @@ if (require.main === module) { .makeOptionMandatory(true) .env('ENV'), ); - program.addOption(new Option('-n, --chainNames ', 'chain names').makeOptionMandatory(true)); + program.addOption(new Option('-n, --chainNames ', 'chain names').makeOptionMandatory(true).env('CHAINS')); program.addOption(new Option('-p, --privateKey ', 'private key').makeOptionMandatory(true).env('PRIVATE_KEY')); program.action((options) => {