From 55f83050db4f047cac59850a5b3ef6a0c73f7e21 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 11:41:57 +0400 Subject: [PATCH 01/23] Allow running integration tests separately --- .github/workflows/integration.yml | 28 ++++-- scripts/integration.sh | 160 ------------------------------ 2 files changed, 21 insertions(+), 167 deletions(-) delete mode 100755 scripts/integration.sh diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 36a55cc3..68fa0c91 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -4,21 +4,35 @@ on: schedule: - cron: "0 0 * * *" # Runs every day at midnight workflow_dispatch: + inputs: + scriptName: + type: choice + description: "Script to run" + options: ${{ env.SCRIPT_NAMES }} + +env: + SCRIPT_NAMES: + '["omnichain_swap", "omnichain_staking", "omnichain_multioutput", + "messaging_counter", "messaging_message", "messaging_value", + "messaging_warriors"]' jobs: - integration: + integration_tests: + name: Run ${{ matrix.scriptName || github.event.inputs.scriptName }} runs-on: ubuntu-latest - + strategy: + matrix: + scriptName: ${{fromJson(env.SCRIPT_NAMES)}} + fail-fast: false steps: - name: Checkout code uses: actions/checkout@v2 - name: Install jq - run: | - sudo apt-get update - sudo apt-get install -y jq + run: sudo apt-get update && sudo apt-get install -y jq - - name: Integration - run: ./scripts/integration.sh + - name: Run Test Script + run: + ./scripts/${{ matrix.scriptName || github.event.inputs.scriptName}}.sh env: PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} diff --git a/scripts/integration.sh b/scripts/integration.sh deleted file mode 100755 index 975d0e0f..00000000 --- a/scripts/integration.sh +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/bash - -set -e - -SENDER=0x2cD3D070aE1BD365909dD859d29F387AA96911e1 - -pushd "./omnichain/swap" - -yarn - -npx hardhat compile --force - -echo "Testing omnichain Swap" - -OMNI_SWAP_CONTRACT=$(npx hardhat deploy --network zeta_testnet --json | jq -r '.address') -# echo "omnichain.swap.zeta_testnet=$OMNI_SWAP_CONTRACT" >> contracts.toml -OMNI_SWAP_TX=$(npx hardhat interact --contract $OMNI_SWAP_CONTRACT --network goerli_testnet --amount 0.01 --recipient $SENDER --destination mumbai_testnet --json | jq -r '.hash') -echo $OMNI_SWAP_TX -OMNI_SWAP_CCTX=$(npx hardhat cctx $OMNI_SWAP_TX --json) -echo $OMNI_SWAP_CCTX - -popd - -pushd "./omnichain/staking" - -yarn - -npx hardhat compile --force - -echo "Testing omnichain Staking" - -OMNI_STAKING_CONTRACT=$(npx hardhat deploy --network zeta_testnet --chain goerli_testnet --json | jq -r '.address') - -echo $OMNI_STAKING_CONTRACT - -echo "Setting beneficiary" -OMNI_STAKING_BENEFICIARY_TX=$(npx hardhat set-beneficiary $SENDER --contract $OMNI_STAKING_CONTRACT --network goerli_testnet --json | jq -r '.hash') -echo $OMNI_STAKING_BENEFICIARY_TX -OMNI_STAKING_BENEFICIARY_CCTX=$(npx hardhat cctx $OMNI_STAKING_BENEFICIARY_TX --json) -echo $OMNI_STAKING_BENEFICIARY_CCTX - -echo "Setting withdraw" -OMNI_STAKING_WITHDRAW_TX=$(npx hardhat set-withdraw --contract $OMNI_STAKING_CONTRACT --network goerli_testnet --json | jq -r '.hash') -echo $OMNI_STAKING_WITHDRAW_TX -OMNI_STAKING_WITHDRAW_CCTX=$(npx hardhat cctx $OMNI_STAKING_WITHDRAW_TX --json) -echo $OMNI_STAKING_WITHDRAW_CCTX - -echo "Stake" -OMNI_STAKING_STAKE_TX=$(npx hardhat stake --amount 0.01 --contract $OMNI_STAKING_CONTRACT --network goerli_testnet --json | jq -r '.hash') -echo $OMNI_STAKING_STAKE_TX -OMNI_STAKING_STAKE_CCTX=$(npx hardhat cctx $OMNI_STAKING_STAKE_TX --json) -echo $OMNI_STAKING_STAKE_CCTX - -echo "Unstake" -OMNI_STAKING_UNSTAKE_TX=$(npx hardhat unstake --contract $OMNI_STAKING_CONTRACT --network goerli_testnet --json | jq -r '.hash') -echo $OMNI_STAKING_UNSTAKE_TX -OMNI_STAKING_UNSTAKE_CCTX=$(npx hardhat cctx $OMNI_STAKING_UNSTAKE_TX --json) -echo $OMNI_STAKING_UNSTAKE_CCTX - -popd - -pushd "./messaging/message" - -yarn - -npx hardhat compile --force - -echo "Testing CCM Message" - -CCM_MESSAGE_CONTRACT=$(npx hardhat deploy --networks goerli_testnet,mumbai_testnet --json) -CCM_MESSAGE_TX_OUT=$(npx hardhat interact --network goerli_testnet --contract $(echo $CCM_MESSAGE_CONTRACT | jq -r '.goerli_testnet') --message "Hello World" --destination mumbai_testnet --amount 0.01 --json ) -echo $CCM_MESSAGE_TX_OUT -CCM_MESSAGE_TX=$(echo $CCM_MESSAGE_TX_OUT | jq -r '.hash') -echo $CCM_MESSAGE_TX -CCM_MESSAGE_CCTX=$(npx hardhat cctx $CCM_MESSAGE_TX --json) -echo $CCM_MESSAGE_CCTX - -popd - -pushd "./messaging/warriors" - -yarn - -npx hardhat compile --force - -echo "Testing CCM Warriors" - -CCM_NFT_CONTRACT=$(npx hardhat deploy --networks goerli_testnet,mumbai_testnet --json | jq -r '.goerli_testnet') -echo $CCM_NFT_CONTRACT - -CCM_NFT_MINT=$(npx hardhat mint --network goerli_testnet --contract $CCM_NFT_CONTRACT --json) -CCM_NFT_TX_OUT=$(npx hardhat interact --network goerli_testnet --contract $CCM_NFT_CONTRACT --token $CCM_NFT_MINT --destination mumbai_testnet --amount 0.01 --to $SENDER --json) -echo $CCM_NFT_TX_OUT -CCM_NFT_TX=$(echo $CCM_NFT_TX_OUT | jq -r '.hash') -echo $CCM_NFT_TX -CCM_NFT_CCTX=$(npx hardhat cctx $CCM_NFT_TX --json) -echo $CCM_NFT_CCTX - -popd - -pushd "./messaging/counter" - -yarn - -npx hardhat compile --force - -echo "Testing CCM Counter" - -CCM_COUNTER_CONTRACT=$(npx hardhat deploy --networks goerli_testnet,mumbai_testnet --json | jq -r '.goerli_testnet') -echo $CCM_COUNTER_CONTRACT -CCM_COUNTER_TX_OUT=$(npx hardhat interact --network goerli_testnet --contract $CCM_COUNTER_CONTRACT --destination mumbai_testnet --amount 0.01 --json) -echo $CCM_COUNTER_TX_OUT -CCM_COUNTER_TX=$(echo $CCM_COUNTER_TX_OUT | jq -r '.hash') -echo $CCM_COUNTER_TX -CCM_COUNTER_CCTX=$(npx hardhat cctx $CCM_COUNTER_TX --json) -echo $CCM_COUNTER_CCTX - -popd - -pushd "./messaging/value" - -yarn - -npx hardhat compile --force - -echo "Testing CCM Value" - -CCM_VALUE_CONTRACT=$(npx hardhat deploy --networks goerli_testnet,mumbai_testnet --json | jq -r '.goerli_testnet') -echo $CCM_VALUE_CONTRACT -PROTOCOL_FEE=$(npx hardhat fees --json | jq -r ".feesCCM.mumbai_testnet.protocolFee") -GAS_FEE=$(npx hardhat fees --json | jq -r ".feesCCM.mumbai_testnet.gasFee") -# Multiply to be on the safe side -CCM_FEE=$(echo "$PROTOCOL_FEE + $GAS_FEE * 3" | bc -l) -CCM_VALUE_TX_OUT=$(npx hardhat interact --network goerli_testnet --contract $CCM_VALUE_CONTRACT --destination mumbai_testnet --amount $CCM_FEE --json) -echo $CCM_VALUE_TX_OUT -CCM_VALUE_TX=$(echo $CCM_VALUE_TX_OUT | jq -r '.hash') -echo $CCM_VALUE_TX -CCM_VALUE_CCTX=$(npx hardhat cctx $CCM_VALUE_TX --json) -echo $CCM_VALUE_CCTX - -popd - -pushd "./omnichain/multioutput" - -yarn - -npx hardhat compile --force - -echo "Testing omnichain Multioutput" - -OMNI_MULTIOUTPUT_CONTRACT=$(npx hardhat deploy --network zeta_testnet --json | jq -r '.address') -echo $OMNI_MULTIOUTPUT_CONTRACT - -npx hardhat destination --contract $OMNI_MULTIOUTPUT_CONTRACT --network zeta_testnet --destination mumbai_testnet -OMNI_MULTIOUTPUT_TX=$(npx hardhat interact --contract $OMNI_MULTIOUTPUT_CONTRACT --network goerli_testnet --amount 0.01 --recipient $SENDER --json | jq -r '.hash') -echo $OMNI_MULTIOUTPUT_TX -OMNI_MULTIOUTPUT_CCTX=$(npx hardhat cctx $OMNI_MULTIOUTPUT_TX --json) -echo $OMNI_MULTIOUTPUT_CCTX - -popd \ No newline at end of file From fd8375c6d1eca289b6078ba3a891eec2d4d6df07 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 11:42:20 +0400 Subject: [PATCH 02/23] add scripts --- scripts/common.sh | 2 ++ scripts/messaging_counter.sh | 24 ++++++++++++++++++ scripts/messaging_message.sh | 23 +++++++++++++++++ scripts/messaging_value.sh | 28 +++++++++++++++++++++ scripts/messaging_warriors.sh | 26 +++++++++++++++++++ scripts/omnichain_mutlioutput.sh | 24 ++++++++++++++++++ scripts/omnichain_staking.sh | 43 ++++++++++++++++++++++++++++++++ scripts/omnichain_swap.sh | 22 ++++++++++++++++ 8 files changed, 192 insertions(+) create mode 100644 scripts/common.sh create mode 100644 scripts/messaging_counter.sh create mode 100644 scripts/messaging_message.sh create mode 100644 scripts/messaging_value.sh create mode 100644 scripts/messaging_warriors.sh create mode 100755 scripts/omnichain_mutlioutput.sh create mode 100755 scripts/omnichain_staking.sh create mode 100755 scripts/omnichain_swap.sh diff --git a/scripts/common.sh b/scripts/common.sh new file mode 100644 index 00000000..1bd2ae8c --- /dev/null +++ b/scripts/common.sh @@ -0,0 +1,2 @@ +#!/bin/bash +SENDER=0x2cD3D070aE1BD365909dD859d29F387AA96911e1 \ No newline at end of file diff --git a/scripts/messaging_counter.sh b/scripts/messaging_counter.sh new file mode 100644 index 00000000..7df2b102 --- /dev/null +++ b/scripts/messaging_counter.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +source "$(dirname "$0")/common.sh" + +pushd "./messaging/counter" + +yarn + +npx hardhat compile --force + +echo "Testing CCM Counter" + +CCM_COUNTER_CONTRACT=$(npx hardhat deploy --networks goerli_testnet,mumbai_testnet --json | jq -r '.goerli_testnet') +echo $CCM_COUNTER_CONTRACT +CCM_COUNTER_TX_OUT=$(npx hardhat interact --network goerli_testnet --contract $CCM_COUNTER_CONTRACT --destination mumbai_testnet --amount 0.01 --json) +echo $CCM_COUNTER_TX_OUT +CCM_COUNTER_TX=$(echo $CCM_COUNTER_TX_OUT | jq -r '.hash') +echo $CCM_COUNTER_TX +CCM_COUNTER_CCTX=$(npx hardhat cctx $CCM_COUNTER_TX --json) +echo $CCM_COUNTER_CCTX + +popd \ No newline at end of file diff --git a/scripts/messaging_message.sh b/scripts/messaging_message.sh new file mode 100644 index 00000000..695d242e --- /dev/null +++ b/scripts/messaging_message.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +source "$(dirname "$0")/common.sh" + +pushd "./messaging/message" + +yarn + +npx hardhat compile --force + +echo "Testing CCM Message" + +CCM_MESSAGE_CONTRACT=$(npx hardhat deploy --networks goerli_testnet,mumbai_testnet --json) +CCM_MESSAGE_TX_OUT=$(npx hardhat interact --network goerli_testnet --contract $(echo $CCM_MESSAGE_CONTRACT | jq -r '.goerli_testnet') --message "Hello World" --destination mumbai_testnet --amount 0.01 --json ) +echo $CCM_MESSAGE_TX_OUT +CCM_MESSAGE_TX=$(echo $CCM_MESSAGE_TX_OUT | jq -r '.hash') +echo $CCM_MESSAGE_TX +CCM_MESSAGE_CCTX=$(npx hardhat cctx $CCM_MESSAGE_TX --json) +echo $CCM_MESSAGE_CCTX + +popd \ No newline at end of file diff --git a/scripts/messaging_value.sh b/scripts/messaging_value.sh new file mode 100644 index 00000000..65e8eeec --- /dev/null +++ b/scripts/messaging_value.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e + +source "$(dirname "$0")/common.sh" + +pushd "./messaging/value" + +yarn + +npx hardhat compile --force + +echo "Testing CCM Value" + +CCM_VALUE_CONTRACT=$(npx hardhat deploy --networks goerli_testnet,mumbai_testnet --json | jq -r '.goerli_testnet') +echo $CCM_VALUE_CONTRACT +PROTOCOL_FEE=$(npx hardhat fees --json | jq -r ".feesCCM.mumbai_testnet.protocolFee") +GAS_FEE=$(npx hardhat fees --json | jq -r ".feesCCM.mumbai_testnet.gasFee") +# Multiply to be on the safe side +CCM_FEE=$(echo "$PROTOCOL_FEE + $GAS_FEE * 3" | bc -l) +CCM_VALUE_TX_OUT=$(npx hardhat interact --network goerli_testnet --contract $CCM_VALUE_CONTRACT --destination mumbai_testnet --amount $CCM_FEE --json) +echo $CCM_VALUE_TX_OUT +CCM_VALUE_TX=$(echo $CCM_VALUE_TX_OUT | jq -r '.hash') +echo $CCM_VALUE_TX +CCM_VALUE_CCTX=$(npx hardhat cctx $CCM_VALUE_TX --json) +echo $CCM_VALUE_CCTX + +popd \ No newline at end of file diff --git a/scripts/messaging_warriors.sh b/scripts/messaging_warriors.sh new file mode 100644 index 00000000..79d224c3 --- /dev/null +++ b/scripts/messaging_warriors.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +source "$(dirname "$0")/common.sh" + +pushd "./messaging/warriors" + +yarn + +npx hardhat compile --force + +echo "Testing CCM Warriors" + +CCM_NFT_CONTRACT=$(npx hardhat deploy --networks goerli_testnet,mumbai_testnet --json | jq -r '.goerli_testnet') +echo $CCM_NFT_CONTRACT + +CCM_NFT_MINT=$(npx hardhat mint --network goerli_testnet --contract $CCM_NFT_CONTRACT --json) +CCM_NFT_TX_OUT=$(npx hardhat interact --network goerli_testnet --contract $CCM_NFT_CONTRACT --token $CCM_NFT_MINT --destination mumbai_testnet --amount 0.01 --to $SENDER --json) +echo $CCM_NFT_TX_OUT +CCM_NFT_TX=$(echo $CCM_NFT_TX_OUT | jq -r '.hash') +echo $CCM_NFT_TX +CCM_NFT_CCTX=$(npx hardhat cctx $CCM_NFT_TX --json) +echo $CCM_NFT_CCTX + +popd \ No newline at end of file diff --git a/scripts/omnichain_mutlioutput.sh b/scripts/omnichain_mutlioutput.sh new file mode 100755 index 00000000..8675a51a --- /dev/null +++ b/scripts/omnichain_mutlioutput.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +source "$(dirname "$0")/common.sh" + +pushd "./omnichain/multioutput" + +yarn + +npx hardhat compile --force + +echo "Testing omnichain Multioutput" + +OMNI_MULTIOUTPUT_CONTRACT=$(npx hardhat deploy --network zeta_testnet --json | jq -r '.address') +echo $OMNI_MULTIOUTPUT_CONTRACT + +npx hardhat destination --contract $OMNI_MULTIOUTPUT_CONTRACT --network zeta_testnet --destination mumbai_testnet +OMNI_MULTIOUTPUT_TX=$(npx hardhat interact --contract $OMNI_MULTIOUTPUT_CONTRACT --network goerli_testnet --amount 0.01 --recipient $SENDER --json | jq -r '.hash') +echo $OMNI_MULTIOUTPUT_TX +OMNI_MULTIOUTPUT_CCTX=$(npx hardhat cctx $OMNI_MULTIOUTPUT_TX --json) +echo $OMNI_MULTIOUTPUT_CCTX + +popd \ No newline at end of file diff --git a/scripts/omnichain_staking.sh b/scripts/omnichain_staking.sh new file mode 100755 index 00000000..0cc2a327 --- /dev/null +++ b/scripts/omnichain_staking.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +set -e + +source "$(dirname "$0")/common.sh" + +pushd "./omnichain/staking" + +yarn + +npx hardhat compile --force + +echo "Testing omnichain Staking" + +OMNI_STAKING_CONTRACT=$(npx hardhat deploy --network zeta_testnet --chain goerli_testnet --json | jq -r '.address') + +echo $OMNI_STAKING_CONTRACT + +echo "Setting beneficiary" +OMNI_STAKING_BENEFICIARY_TX=$(npx hardhat set-beneficiary $SENDER --contract $OMNI_STAKING_CONTRACT --network goerli_testnet --json | jq -r '.hash') +echo $OMNI_STAKING_BENEFICIARY_TX +OMNI_STAKING_BENEFICIARY_CCTX=$(npx hardhat cctx $OMNI_STAKING_BENEFICIARY_TX --json) +echo $OMNI_STAKING_BENEFICIARY_CCTX + +echo "Setting withdraw" +OMNI_STAKING_WITHDRAW_TX=$(npx hardhat set-withdraw --contract $OMNI_STAKING_CONTRACT --network goerli_testnet --json | jq -r '.hash') +echo $OMNI_STAKING_WITHDRAW_TX +OMNI_STAKING_WITHDRAW_CCTX=$(npx hardhat cctx $OMNI_STAKING_WITHDRAW_TX --json) +echo $OMNI_STAKING_WITHDRAW_CCTX + +echo "Stake" +OMNI_STAKING_STAKE_TX=$(npx hardhat stake --amount 0.01 --contract $OMNI_STAKING_CONTRACT --network goerli_testnet --json | jq -r '.hash') +echo $OMNI_STAKING_STAKE_TX +OMNI_STAKING_STAKE_CCTX=$(npx hardhat cctx $OMNI_STAKING_STAKE_TX --json) +echo $OMNI_STAKING_STAKE_CCTX + +echo "Unstake" +OMNI_STAKING_UNSTAKE_TX=$(npx hardhat unstake --contract $OMNI_STAKING_CONTRACT --network goerli_testnet --json | jq -r '.hash') +echo $OMNI_STAKING_UNSTAKE_TX +OMNI_STAKING_UNSTAKE_CCTX=$(npx hardhat cctx $OMNI_STAKING_UNSTAKE_TX --json) +echo $OMNI_STAKING_UNSTAKE_CCTX + +popd \ No newline at end of file diff --git a/scripts/omnichain_swap.sh b/scripts/omnichain_swap.sh new file mode 100755 index 00000000..1a46241d --- /dev/null +++ b/scripts/omnichain_swap.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +source "$(dirname "$0")/common.sh" + +pushd "./omnichain/swap" + +yarn + +npx hardhat compile --force + +echo "Testing omnichain Swap" + +OMNI_SWAP_CONTRACT=$(npx hardhat deploy --network zeta_testnet --json | jq -r '.address') +# echo "omnichain.swap.zeta_testnet=$OMNI_SWAP_CONTRACT" >> contracts.toml +OMNI_SWAP_TX=$(npx hardhat interact --contract $OMNI_SWAP_CONTRACT --network goerli_testnet --amount 0.01 --recipient $SENDER --destination mumbai_testnet --json | jq -r '.hash') +echo $OMNI_SWAP_TX +OMNI_SWAP_CCTX=$(npx hardhat cctx $OMNI_SWAP_TX --json) +echo $OMNI_SWAP_CCTX + +popd \ No newline at end of file From 2dfbafb46bf7a79d795b3f0430c37c54bbe72f97 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 11:44:39 +0400 Subject: [PATCH 03/23] workflow --- .github/workflows/integration.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 68fa0c91..5d56277f 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,20 +1,21 @@ name: Integration Tests on: - schedule: - - cron: "0 0 * * *" # Runs every day at midnight workflow_dispatch: inputs: scriptName: type: choice description: "Script to run" - options: ${{ env.SCRIPT_NAMES }} - -env: - SCRIPT_NAMES: - '["omnichain_swap", "omnichain_staking", "omnichain_multioutput", - "messaging_counter", "messaging_message", "messaging_value", - "messaging_warriors"]' + options: + - omnichain_swap + - omnichain_staking + - omnichain_multioutput + - messaging_counter + - messaging_message + - messaging_value + - messaging_warriors + schedule: + - cron: "0 0 * * *" # Runs every day at midnight jobs: integration_tests: @@ -22,7 +23,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - scriptName: ${{fromJson(env.SCRIPT_NAMES)}} + scriptName: + - omnichain_swap + - omnichain_staking + - omnichain_multioutput + - messaging_counter + - messaging_message + - messaging_value + - messaging_warriors fail-fast: false steps: - name: Checkout code From 0cf0473b93f54803095cc0563853284c313248c8 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:02:14 +0400 Subject: [PATCH 04/23] making scripts run in sequence --- .github/workflows/integration.yml | 41 ++++++++++++++----------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 5d56277f..af964c48 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,37 +1,29 @@ name: Integration Tests +env: + SCRIPT_NAMES: | + omnichain_swap + omnichain_staking + omnichain_multioutput + messaging_counter + messaging_message + messaging_value + messaging_warriors + on: workflow_dispatch: inputs: scriptName: type: choice description: "Script to run" - options: - - omnichain_swap - - omnichain_staking - - omnichain_multioutput - - messaging_counter - - messaging_message - - messaging_value - - messaging_warriors + options: ${{ env.SCRIPT_NAMES }} schedule: - cron: "0 0 * * *" # Runs every day at midnight jobs: integration_tests: - name: Run ${{ matrix.scriptName || github.event.inputs.scriptName }} + name: Run integration tests in sequence runs-on: ubuntu-latest - strategy: - matrix: - scriptName: - - omnichain_swap - - omnichain_staking - - omnichain_multioutput - - messaging_counter - - messaging_message - - messaging_value - - messaging_warriors - fail-fast: false steps: - name: Checkout code uses: actions/checkout@v2 @@ -39,8 +31,11 @@ jobs: - name: Install jq run: sudo apt-get update && sudo apt-get install -y jq - - name: Run Test Script - run: - ./scripts/${{ matrix.scriptName || github.event.inputs.scriptName}}.sh + - name: Run scripts in sequence + run: | + for script in ${{ env.SCRIPT_NAMES }} + do + ./scripts/$script.sh + done env: PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} From ba3931f216ff15245807979845f8946c17523d1f Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:13:24 +0400 Subject: [PATCH 05/23] two workflows --- .github/workflows/integration.yml | 47 +++++++++++++-------- scripts/{ => test}/messaging_counter.sh | 2 +- scripts/{ => test}/messaging_message.sh | 2 +- scripts/{ => test}/messaging_value.sh | 2 +- scripts/{ => test}/messaging_warriors.sh | 2 +- scripts/{ => test}/omnichain_mutlioutput.sh | 2 +- scripts/{ => test}/omnichain_staking.sh | 2 +- scripts/{ => test}/omnichain_swap.sh | 4 +- 8 files changed, 39 insertions(+), 24 deletions(-) rename scripts/{ => test}/messaging_counter.sh (94%) rename scripts/{ => test}/messaging_message.sh (94%) rename scripts/{ => test}/messaging_value.sh (95%) rename scripts/{ => test}/messaging_warriors.sh (94%) rename scripts/{ => test}/omnichain_mutlioutput.sh (94%) rename scripts/{ => test}/omnichain_staking.sh (97%) rename scripts/{ => test}/omnichain_swap.sh (91%) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index af964c48..13208120 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,28 +1,24 @@ name: Integration Tests -env: - SCRIPT_NAMES: | - omnichain_swap - omnichain_staking - omnichain_multioutput - messaging_counter - messaging_message - messaging_value - messaging_warriors - on: workflow_dispatch: inputs: scriptName: type: choice description: "Script to run" - options: ${{ env.SCRIPT_NAMES }} + options: + - omnichain_swap + - omnichain_staking + - omnichain_multioutput + - messaging_counter + - messaging_message + - messaging_value + - messaging_warriors schedule: - cron: "0 0 * * *" # Runs every day at midnight jobs: - integration_tests: - name: Run integration tests in sequence + setup: runs-on: ubuntu-latest steps: - name: Checkout code @@ -31,11 +27,28 @@ jobs: - name: Install jq run: sudo apt-get update && sudo apt-get install -y jq - - name: Run scripts in sequence + scheduled_integration_tests: + needs: setup + if: github.event_name == 'schedule' + runs-on: ubuntu-latest + steps: + - name: Run All Scripts in scripts/test Directory run: | - for script in ${{ env.SCRIPT_NAMES }} - do - ./scripts/$script.sh + for script in scripts/test/*; do + if [ -f "$script" ] && [ -x "$script" ]; then + echo "Running $script..." + ./$script + fi done env: PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} + + manual_integration_tests: + needs: setup + if: github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + steps: + - name: Run Test Script + run: ./scripts/${{ github.event.inputs.scriptName }}.sh + env: + PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} diff --git a/scripts/messaging_counter.sh b/scripts/test/messaging_counter.sh similarity index 94% rename from scripts/messaging_counter.sh rename to scripts/test/messaging_counter.sh index 7df2b102..4f3ca8e3 100644 --- a/scripts/messaging_counter.sh +++ b/scripts/test/messaging_counter.sh @@ -2,7 +2,7 @@ set -e -source "$(dirname "$0")/common.sh" +source "$(dirname "$0")/../common.sh" pushd "./messaging/counter" diff --git a/scripts/messaging_message.sh b/scripts/test/messaging_message.sh similarity index 94% rename from scripts/messaging_message.sh rename to scripts/test/messaging_message.sh index 695d242e..c595b339 100644 --- a/scripts/messaging_message.sh +++ b/scripts/test/messaging_message.sh @@ -2,7 +2,7 @@ set -e -source "$(dirname "$0")/common.sh" +source "$(dirname "$0")/../common.sh" pushd "./messaging/message" diff --git a/scripts/messaging_value.sh b/scripts/test/messaging_value.sh similarity index 95% rename from scripts/messaging_value.sh rename to scripts/test/messaging_value.sh index 65e8eeec..dadd40bb 100644 --- a/scripts/messaging_value.sh +++ b/scripts/test/messaging_value.sh @@ -2,7 +2,7 @@ set -e -source "$(dirname "$0")/common.sh" +source "$(dirname "$0")/../common.sh" pushd "./messaging/value" diff --git a/scripts/messaging_warriors.sh b/scripts/test/messaging_warriors.sh similarity index 94% rename from scripts/messaging_warriors.sh rename to scripts/test/messaging_warriors.sh index 79d224c3..ff30fb5d 100644 --- a/scripts/messaging_warriors.sh +++ b/scripts/test/messaging_warriors.sh @@ -2,7 +2,7 @@ set -e -source "$(dirname "$0")/common.sh" +source "$(dirname "$0")/../common.sh" pushd "./messaging/warriors" diff --git a/scripts/omnichain_mutlioutput.sh b/scripts/test/omnichain_mutlioutput.sh similarity index 94% rename from scripts/omnichain_mutlioutput.sh rename to scripts/test/omnichain_mutlioutput.sh index 8675a51a..75586b9a 100755 --- a/scripts/omnichain_mutlioutput.sh +++ b/scripts/test/omnichain_mutlioutput.sh @@ -2,7 +2,7 @@ set -e -source "$(dirname "$0")/common.sh" +source "$(dirname "$0")/../common.sh" pushd "./omnichain/multioutput" diff --git a/scripts/omnichain_staking.sh b/scripts/test/omnichain_staking.sh similarity index 97% rename from scripts/omnichain_staking.sh rename to scripts/test/omnichain_staking.sh index 0cc2a327..825201df 100755 --- a/scripts/omnichain_staking.sh +++ b/scripts/test/omnichain_staking.sh @@ -2,7 +2,7 @@ set -e -source "$(dirname "$0")/common.sh" +source "$(dirname "$0")/../common.sh" pushd "./omnichain/staking" diff --git a/scripts/omnichain_swap.sh b/scripts/test/omnichain_swap.sh similarity index 91% rename from scripts/omnichain_swap.sh rename to scripts/test/omnichain_swap.sh index 1a46241d..cb4eaf6f 100755 --- a/scripts/omnichain_swap.sh +++ b/scripts/test/omnichain_swap.sh @@ -2,7 +2,9 @@ set -e -source "$(dirname "$0")/common.sh" +source "$(dirname "$0")/../common.sh" + +echo $SENDER pushd "./omnichain/swap" From 21bd8c3195a95e0d7967ef2336a1a9e49c3b98df Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:15:15 +0400 Subject: [PATCH 06/23] fix path --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 13208120..466e4dff 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -49,6 +49,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Run Test Script - run: ./scripts/${{ github.event.inputs.scriptName }}.sh + run: ./scripts/test/${{ github.event.inputs.scriptName }}.sh env: PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} From 9e18ad44e5e24e7b3b26e6b5a7d59117650d34c5 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:19:42 +0400 Subject: [PATCH 07/23] fix path --- .github/workflows/integration.yml | 3 ++- scripts/test/messaging_warriors.sh | 0 2 files changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 scripts/test/messaging_warriors.sh diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 466e4dff..71f90d6a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -49,6 +49,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run Test Script - run: ./scripts/test/${{ github.event.inputs.scriptName }}.sh + run: | + ${{ github.workspace }}/scripts/test/${{ github.event.inputs.scriptName }}.sh env: PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} diff --git a/scripts/test/messaging_warriors.sh b/scripts/test/messaging_warriors.sh old mode 100644 new mode 100755 From 22ea5cf801fef8b2690aff9b63df358066b3f5b6 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:25:03 +0400 Subject: [PATCH 08/23] test --- scripts/test/omnichain_swap.sh | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/scripts/test/omnichain_swap.sh b/scripts/test/omnichain_swap.sh index cb4eaf6f..92a27ec2 100755 --- a/scripts/test/omnichain_swap.sh +++ b/scripts/test/omnichain_swap.sh @@ -2,23 +2,25 @@ set -e -source "$(dirname "$0")/../common.sh" +echo "Testing omnichain Swap" -echo $SENDER +# source "$(dirname "$0")/../common.sh" -pushd "./omnichain/swap" +# echo $SENDER -yarn +# pushd "./omnichain/swap" -npx hardhat compile --force +# yarn -echo "Testing omnichain Swap" +# npx hardhat compile --force + +# echo "Testing omnichain Swap" -OMNI_SWAP_CONTRACT=$(npx hardhat deploy --network zeta_testnet --json | jq -r '.address') -# echo "omnichain.swap.zeta_testnet=$OMNI_SWAP_CONTRACT" >> contracts.toml -OMNI_SWAP_TX=$(npx hardhat interact --contract $OMNI_SWAP_CONTRACT --network goerli_testnet --amount 0.01 --recipient $SENDER --destination mumbai_testnet --json | jq -r '.hash') -echo $OMNI_SWAP_TX -OMNI_SWAP_CCTX=$(npx hardhat cctx $OMNI_SWAP_TX --json) -echo $OMNI_SWAP_CCTX +# OMNI_SWAP_CONTRACT=$(npx hardhat deploy --network zeta_testnet --json | jq -r '.address') +# # echo "omnichain.swap.zeta_testnet=$OMNI_SWAP_CONTRACT" >> contracts.toml +# OMNI_SWAP_TX=$(npx hardhat interact --contract $OMNI_SWAP_CONTRACT --network goerli_testnet --amount 0.01 --recipient $SENDER --destination mumbai_testnet --json | jq -r '.hash') +# echo $OMNI_SWAP_TX +# OMNI_SWAP_CCTX=$(npx hardhat cctx $OMNI_SWAP_TX --json) +# echo $OMNI_SWAP_CCTX -popd \ No newline at end of file +# popd \ No newline at end of file From 40cc8aa34f80763e4a176dc928cfab64e52d0702 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:26:10 +0400 Subject: [PATCH 09/23] test --- .github/workflows/integration.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 71f90d6a..8f527d32 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -50,6 +50,8 @@ jobs: steps: - name: Run Test Script run: | + echo $PWD + ls ${{ github.workspace }}/scripts/test/${{ github.event.inputs.scriptName }}.sh env: PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} From 3fae0e60bb891e8e23c8ee9bfc39ffde50026a18 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:26:20 +0400 Subject: [PATCH 10/23] test --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8f527d32..7ed1710c 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -52,6 +52,6 @@ jobs: run: | echo $PWD ls - ${{ github.workspace }}/scripts/test/${{ github.event.inputs.scriptName }}.sh + sh ${{ github.workspace }}/scripts/test/${{ github.event.inputs.scriptName }}.sh env: PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} From a5c2c42e270cbe489dd3805c30c27f4657ed5495 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:30:52 +0400 Subject: [PATCH 11/23] test --- .github/workflows/integration.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 7ed1710c..0f69e4ef 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -48,10 +48,14 @@ jobs: if: github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - - name: Run Test Script + - name: Print Current Directory + run: echo $(pwd) + + - name: List Files + run: ls -al scripts/test/ + + - name: Run Script run: | - echo $PWD - ls - sh ${{ github.workspace }}/scripts/test/${{ github.event.inputs.scriptName }}.sh + sh /home/runner/work/example-contracts/example-contracts/scripts/test/omnichain_swap.sh env: PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} From 9bb3e0c51d5c59efbc9c9d6d70864d02bd22de71 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:32:11 +0400 Subject: [PATCH 12/23] test --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 0f69e4ef..0272e1c4 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -52,7 +52,7 @@ jobs: run: echo $(pwd) - name: List Files - run: ls -al scripts/test/ + run: ls -al . - name: Run Script run: | From fe5bdd2efd671b4b673089dadfa997c6f388589f Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:32:23 +0400 Subject: [PATCH 13/23] test --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 0272e1c4..90061a2b 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -56,6 +56,6 @@ jobs: - name: Run Script run: | - sh /home/runner/work/example-contracts/example-contracts/scripts/test/omnichain_swap.sh + sh /home/runner/work/example-contracts/scripts/test/omnichain_swap.sh env: PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} From feedbcded0e0fa9f9715bc5881f87654c31982ec Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:36:04 +0400 Subject: [PATCH 14/23] test --- .github/workflows/integration.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 90061a2b..ff9b326f 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -18,7 +18,8 @@ on: - cron: "0 0 * * *" # Runs every day at midnight jobs: - setup: + scheduled_integration_tests: + if: github.event_name == 'schedule' runs-on: ubuntu-latest steps: - name: Checkout code @@ -27,11 +28,6 @@ jobs: - name: Install jq run: sudo apt-get update && sudo apt-get install -y jq - scheduled_integration_tests: - needs: setup - if: github.event_name == 'schedule' - runs-on: ubuntu-latest - steps: - name: Run All Scripts in scripts/test Directory run: | for script in scripts/test/*; do @@ -44,18 +40,17 @@ jobs: PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} manual_integration_tests: - needs: setup if: github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - - name: Print Current Directory - run: echo $(pwd) + - name: Checkout code + uses: actions/checkout@v2 - - name: List Files - run: ls -al . + - name: Install jq + run: sudo apt-get update && sudo apt-get install -y jq - name: Run Script run: | - sh /home/runner/work/example-contracts/scripts/test/omnichain_swap.sh + sh ${{ github.workspace }}/scripts/test/${{ github.event.inputs.scriptName }}.sh env: PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} From bca045f40fec2da5c5ca671d3bebb2eda63d9049 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:37:03 +0400 Subject: [PATCH 15/23] test --- scripts/test/omnichain_swap.sh | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/scripts/test/omnichain_swap.sh b/scripts/test/omnichain_swap.sh index 92a27ec2..cb4eaf6f 100755 --- a/scripts/test/omnichain_swap.sh +++ b/scripts/test/omnichain_swap.sh @@ -2,25 +2,23 @@ set -e -echo "Testing omnichain Swap" - -# source "$(dirname "$0")/../common.sh" +source "$(dirname "$0")/../common.sh" -# echo $SENDER +echo $SENDER -# pushd "./omnichain/swap" +pushd "./omnichain/swap" -# yarn +yarn -# npx hardhat compile --force +npx hardhat compile --force -# echo "Testing omnichain Swap" +echo "Testing omnichain Swap" -# OMNI_SWAP_CONTRACT=$(npx hardhat deploy --network zeta_testnet --json | jq -r '.address') -# # echo "omnichain.swap.zeta_testnet=$OMNI_SWAP_CONTRACT" >> contracts.toml -# OMNI_SWAP_TX=$(npx hardhat interact --contract $OMNI_SWAP_CONTRACT --network goerli_testnet --amount 0.01 --recipient $SENDER --destination mumbai_testnet --json | jq -r '.hash') -# echo $OMNI_SWAP_TX -# OMNI_SWAP_CCTX=$(npx hardhat cctx $OMNI_SWAP_TX --json) -# echo $OMNI_SWAP_CCTX +OMNI_SWAP_CONTRACT=$(npx hardhat deploy --network zeta_testnet --json | jq -r '.address') +# echo "omnichain.swap.zeta_testnet=$OMNI_SWAP_CONTRACT" >> contracts.toml +OMNI_SWAP_TX=$(npx hardhat interact --contract $OMNI_SWAP_CONTRACT --network goerli_testnet --amount 0.01 --recipient $SENDER --destination mumbai_testnet --json | jq -r '.hash') +echo $OMNI_SWAP_TX +OMNI_SWAP_CCTX=$(npx hardhat cctx $OMNI_SWAP_TX --json) +echo $OMNI_SWAP_CCTX -# popd \ No newline at end of file +popd \ No newline at end of file From 9cfab054a0e962708a0a1785407a72f2a91d7991 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:40:39 +0400 Subject: [PATCH 16/23] test --- scripts/test/omnichain_swap.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/test/omnichain_swap.sh b/scripts/test/omnichain_swap.sh index cb4eaf6f..2125568e 100755 --- a/scripts/test/omnichain_swap.sh +++ b/scripts/test/omnichain_swap.sh @@ -2,23 +2,23 @@ set -e -source "$(dirname "$0")/../common.sh" +echo "testing swap" -echo $SENDER +# source "$(dirname "$0")/../common.sh" -pushd "./omnichain/swap" +# pushd "./omnichain/swap" -yarn +# yarn -npx hardhat compile --force +# npx hardhat compile --force -echo "Testing omnichain Swap" +# echo "Testing omnichain Swap" -OMNI_SWAP_CONTRACT=$(npx hardhat deploy --network zeta_testnet --json | jq -r '.address') -# echo "omnichain.swap.zeta_testnet=$OMNI_SWAP_CONTRACT" >> contracts.toml -OMNI_SWAP_TX=$(npx hardhat interact --contract $OMNI_SWAP_CONTRACT --network goerli_testnet --amount 0.01 --recipient $SENDER --destination mumbai_testnet --json | jq -r '.hash') -echo $OMNI_SWAP_TX -OMNI_SWAP_CCTX=$(npx hardhat cctx $OMNI_SWAP_TX --json) -echo $OMNI_SWAP_CCTX +# OMNI_SWAP_CONTRACT=$(npx hardhat deploy --network zeta_testnet --json | jq -r '.address') +# # echo "omnichain.swap.zeta_testnet=$OMNI_SWAP_CONTRACT" >> contracts.toml +# OMNI_SWAP_TX=$(npx hardhat interact --contract $OMNI_SWAP_CONTRACT --network goerli_testnet --amount 0.01 --recipient $SENDER --destination mumbai_testnet --json | jq -r '.hash') +# echo $OMNI_SWAP_TX +# OMNI_SWAP_CCTX=$(npx hardhat cctx $OMNI_SWAP_TX --json) +# echo $OMNI_SWAP_CCTX -popd \ No newline at end of file +# popd \ No newline at end of file From ebe5161b1829a3f9c7813bbf186d9dcae5281dbd Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:41:30 +0400 Subject: [PATCH 17/23] test --- scripts/test/omnichain_swap.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/test/omnichain_swap.sh b/scripts/test/omnichain_swap.sh index 2125568e..5849e480 100755 --- a/scripts/test/omnichain_swap.sh +++ b/scripts/test/omnichain_swap.sh @@ -4,7 +4,9 @@ set -e echo "testing swap" -# source "$(dirname "$0")/../common.sh" +source "$(dirname "$0")/../common.sh" + +echo $SENDER # pushd "./omnichain/swap" From 825b9116bcb61d13327997c434ec95f3be9b1488 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:42:41 +0400 Subject: [PATCH 18/23] test --- scripts/test/omnichain_swap.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/test/omnichain_swap.sh b/scripts/test/omnichain_swap.sh index 5849e480..6431ce5d 100755 --- a/scripts/test/omnichain_swap.sh +++ b/scripts/test/omnichain_swap.sh @@ -2,25 +2,25 @@ set -e -echo "testing swap" +# echo "testing swap" -source "$(dirname "$0")/../common.sh" +# source "$(dirname "$0")/../common.sh" -echo $SENDER +SENDER=0x2cD3D070aE1BD365909dD859d29F387AA96911e1 -# pushd "./omnichain/swap" +pushd "./omnichain/swap" -# yarn +yarn -# npx hardhat compile --force +npx hardhat compile --force -# echo "Testing omnichain Swap" +echo "Testing omnichain Swap" -# OMNI_SWAP_CONTRACT=$(npx hardhat deploy --network zeta_testnet --json | jq -r '.address') -# # echo "omnichain.swap.zeta_testnet=$OMNI_SWAP_CONTRACT" >> contracts.toml -# OMNI_SWAP_TX=$(npx hardhat interact --contract $OMNI_SWAP_CONTRACT --network goerli_testnet --amount 0.01 --recipient $SENDER --destination mumbai_testnet --json | jq -r '.hash') -# echo $OMNI_SWAP_TX -# OMNI_SWAP_CCTX=$(npx hardhat cctx $OMNI_SWAP_TX --json) -# echo $OMNI_SWAP_CCTX +OMNI_SWAP_CONTRACT=$(npx hardhat deploy --network zeta_testnet --json | jq -r '.address') +# echo "omnichain.swap.zeta_testnet=$OMNI_SWAP_CONTRACT" >> contracts.toml +OMNI_SWAP_TX=$(npx hardhat interact --contract $OMNI_SWAP_CONTRACT --network goerli_testnet --amount 0.01 --recipient $SENDER --destination mumbai_testnet --json | jq -r '.hash') +echo $OMNI_SWAP_TX +OMNI_SWAP_CCTX=$(npx hardhat cctx $OMNI_SWAP_TX --json) +echo $OMNI_SWAP_CCTX -# popd \ No newline at end of file +popd \ No newline at end of file From 5513dac89dfe2d2c78719e0b492d86a8cb675ca2 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:43:40 +0400 Subject: [PATCH 19/23] test --- scripts/test/omnichain_swap.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/test/omnichain_swap.sh b/scripts/test/omnichain_swap.sh index 6431ce5d..2cfadb43 100755 --- a/scripts/test/omnichain_swap.sh +++ b/scripts/test/omnichain_swap.sh @@ -8,7 +8,10 @@ set -e SENDER=0x2cD3D070aE1BD365909dD859d29F387AA96911e1 -pushd "./omnichain/swap" +echo $PWD +ls -al + +# pushd "./omnichain/swap" yarn From cd4e0e1af5bba95e085d8122e81112b86a5160ab Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:45:11 +0400 Subject: [PATCH 20/23] test --- scripts/test/omnichain_swap.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/test/omnichain_swap.sh b/scripts/test/omnichain_swap.sh index 2cfadb43..55782be0 100755 --- a/scripts/test/omnichain_swap.sh +++ b/scripts/test/omnichain_swap.sh @@ -8,10 +8,9 @@ set -e SENDER=0x2cD3D070aE1BD365909dD859d29F387AA96911e1 -echo $PWD -ls -al +echo "$(dirname "$0")/../common.sh" -# pushd "./omnichain/swap" +cd ./omnichain/swap yarn From 1e041b3c28a6c851efecace1066eca90afe28dc9 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:45:19 +0400 Subject: [PATCH 21/23] test --- scripts/test/omnichain_swap.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/test/omnichain_swap.sh b/scripts/test/omnichain_swap.sh index 55782be0..8dec3450 100755 --- a/scripts/test/omnichain_swap.sh +++ b/scripts/test/omnichain_swap.sh @@ -23,6 +23,4 @@ OMNI_SWAP_CONTRACT=$(npx hardhat deploy --network zeta_testnet --json | jq -r '. OMNI_SWAP_TX=$(npx hardhat interact --contract $OMNI_SWAP_CONTRACT --network goerli_testnet --amount 0.01 --recipient $SENDER --destination mumbai_testnet --json | jq -r '.hash') echo $OMNI_SWAP_TX OMNI_SWAP_CCTX=$(npx hardhat cctx $OMNI_SWAP_TX --json) -echo $OMNI_SWAP_CCTX - -popd \ No newline at end of file +echo $OMNI_SWAP_CCTX \ No newline at end of file From 5f89b874c4689a87378f891e7f9a983b9db2f493 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:47:00 +0400 Subject: [PATCH 22/23] test --- scripts/test/omnichain_swap.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/test/omnichain_swap.sh b/scripts/test/omnichain_swap.sh index 8dec3450..e6b04c0d 100755 --- a/scripts/test/omnichain_swap.sh +++ b/scripts/test/omnichain_swap.sh @@ -2,13 +2,7 @@ set -e -# echo "testing swap" - -# source "$(dirname "$0")/../common.sh" - -SENDER=0x2cD3D070aE1BD365909dD859d29F387AA96911e1 - -echo "$(dirname "$0")/../common.sh" +source "$(dirname "$0")/../common.sh" cd ./omnichain/swap From ee8da9b22fbc1cded09ca5a67f780da7579ea994 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 12:49:14 +0400 Subject: [PATCH 23/23] test --- scripts/test/omnichain_swap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test/omnichain_swap.sh b/scripts/test/omnichain_swap.sh index e6b04c0d..c849d37c 100755 --- a/scripts/test/omnichain_swap.sh +++ b/scripts/test/omnichain_swap.sh @@ -2,7 +2,7 @@ set -e -source "$(dirname "$0")/../common.sh" +source ./scripts/common.sh cd ./omnichain/swap