From fcfcada0a3ff4add772ab68e924a00ef48e750da Mon Sep 17 00:00:00 2001 From: riley-stride <104941670+riley-stride@users.noreply.github.com> Date: Fri, 12 Jan 2024 00:16:10 -0600 Subject: [PATCH] upgrade integration tests for v17 (#1073) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` integration_tests.bats ✓ [INTEGRATION-BASIC-GAIA] host zones successfully registered ✓ [INTEGRATION-BASIC-GAIA] ibc transfer ✓ [INTEGRATION-BASIC-GAIA] liquid stake mint and transfer ✓ [INTEGRATION-BASIC-GAIA] delegation on GAIA ✓ [INTEGRATION-BASIC-GAIA] LSM liquid stake ✓ [INTEGRATION-BASIC-GAIA] LSM liquid stake with slash query ✓ [INTEGRATION-BASIC-GAIA] autopilot liquid stake ✓ [INTEGRATION-BASIC-GAIA] autopilot liquid stake and transfer ✓ [INTEGRATION-BASIC-GAIA] autopilot redeem stake ✓ [INTEGRATION-BASIC-GAIA] redemption and undelegation on GAIA ✓ [INTEGRATION-BASIC-GAIA] claim redeemed tokens ✓ [INTEGRATION-BASIC-GAIA] rewards are being reinvested, exchange rate updating ✓ [INTEGRATION-BASIC-GAIA] rewards are being distributed to stakers 13 tests, 0 failures integration_tests.bats ✓ [INTEGRATION-BASIC-EVMOS] host zones successfully registered ✓ [INTEGRATION-BASIC-EVMOS] ibc transfer ✓ [INTEGRATION-BASIC-EVMOS] liquid stake mint and transfer ✓ [INTEGRATION-BASIC-EVMOS] delegation on EVMOS - [INTEGRATION-BASIC-EVMOS] LSM liquid stake (skipped: Skipping LSM liquid stake for chains without LSM support) - [INTEGRATION-BASIC-EVMOS] LSM liquid stake with slash query (skipped: Skipping LSM liquid stake for chains without LSM support) ✓ [INTEGRATION-BASIC-EVMOS] autopilot liquid stake ✓ [INTEGRATION-BASIC-EVMOS] autopilot liquid stake and transfer ✓ [INTEGRATION-BASIC-EVMOS] autopilot redeem stake ✓ [INTEGRATION-BASIC-EVMOS] redemption and undelegation on EVMOS ✓ [INTEGRATION-BASIC-EVMOS] claim redeemed tokens ✓ [INTEGRATION-BASIC-EVMOS] rewards are being reinvested, exchange rate updating ✓ [INTEGRATION-BASIC-EVMOS] rewards are being distributed to stakers 13 tests, 0 failures, 2 skipped integration_tests.bats ✓ [INTEGRATION-BASIC-HOST] host zones successfully registered ✓ [INTEGRATION-BASIC-HOST] ibc transfer ✓ [INTEGRATION-BASIC-HOST] liquid stake mint and transfer ✓ [INTEGRATION-BASIC-HOST] delegation on HOST - [INTEGRATION-BASIC-HOST] LSM liquid stake (skipped: Skipping LSM liquid stake for chains without LSM support) - [INTEGRATION-BASIC-HOST] LSM liquid stake with slash query (skipped: Skipping LSM liquid stake for chains without LSM support) ✓ [INTEGRATION-BASIC-HOST] autopilot liquid stake ✓ [INTEGRATION-BASIC-HOST] autopilot liquid stake and transfer ✓ [INTEGRATION-BASIC-HOST] autopilot redeem stake ✓ [INTEGRATION-BASIC-HOST] redemption and undelegation on HOST ✓ [INTEGRATION-BASIC-HOST] claim redeemed tokens ✓ [INTEGRATION-BASIC-HOST] rewards are being reinvested, exchange rate updating ✓ [INTEGRATION-BASIC-HOST] rewards are being distributed to stakers 13 tests, 0 failures, 2 skipped ``` --- Makefile | 2 +- dockernet/config.sh | 1 + dockernet/dockerfiles/Dockerfile.evmos | 2 +- dockernet/tests/integration_tests.bats | 55 ++++---------------------- 4 files changed, 10 insertions(+), 50 deletions(-) diff --git a/Makefile b/Makefile index e057877f99..ba908dd52d 100644 --- a/Makefile +++ b/Makefile @@ -143,7 +143,7 @@ submit-upgrade-immediately: UPGRADE_HEIGHT=150 bash $(DOCKERNET_HOME)/upgrades/submit_upgrade.sh submit-upgrade-after-tests: - UPGRADE_HEIGHT=700 bash $(DOCKERNET_HOME)/upgrades/submit_upgrade.sh + UPGRADE_HEIGHT=500 bash $(DOCKERNET_HOME)/upgrades/submit_upgrade.sh start-upgrade-integration-tests: PART=1 bash $(DOCKERNET_HOME)/tests/run_tests_upgrade.sh diff --git a/dockernet/config.sh b/dockernet/config.sh index 4037e42cfe..38d99fe7cb 100755 --- a/dockernet/config.sh +++ b/dockernet/config.sh @@ -104,6 +104,7 @@ IBC_DYDX_CHANNEL_3_DENOM='ibc/6301148031C0AC9A392C2DDB1B2D1F11B3B9D0A3ECF20C6B51 IBC_GAIA_STDENOM='ibc/054A44EC8D9B68B9A6F0D5708375E00A5569A28F21E0064FF12CADC3FEF1D04F' IBC_HOST_STDENOM='ibc/E3AF56419340E719710C088D3855F65C4717E1A0C3B405F0C1D16F2A54E89421' +IBC_EVMOS_STDENOM='ibc/04CDA5EBB8A7E94BB60879B7F43EF0EDD2604990D8AB5BA18ADCB173F66FF874' # COIN TYPES # Coin types can be found at https://github.com/satoshilabs/slips/blob/master/slip-0044.md diff --git a/dockernet/dockerfiles/Dockerfile.evmos b/dockernet/dockerfiles/Dockerfile.evmos index 32ef44d926..9545667c56 100644 --- a/dockernet/dockerfiles/Dockerfile.evmos +++ b/dockernet/dockerfiles/Dockerfile.evmos @@ -1,4 +1,4 @@ -FROM golang:1.19-alpine3.15 AS builder +FROM golang:1.20-alpine3.19 AS builder WORKDIR /opt/ diff --git a/dockernet/tests/integration_tests.bats b/dockernet/tests/integration_tests.bats index c9751e57b7..486bda787f 100644 --- a/dockernet/tests/integration_tests.bats +++ b/dockernet/tests/integration_tests.bats @@ -34,10 +34,7 @@ setup_file() { HOST_TRANSFER_CHANNEL="channel-0" # IBC sttoken is only needed for autopilot tests which run on GAIA and HOST - IBC_STTOKEN="N/A" - if [[ "$CHAIN_NAME" == "GAIA" || "$CHAIN_NAME" == "HOST" ]]; then - IBC_STTOKEN=$(GET_VAR_VALUE IBC_${CHAIN_NAME}_STDENOM) - fi + IBC_STTOKEN=$(GET_VAR_VALUE IBC_${CHAIN_NAME}_STDENOM) TRANSFER_AMOUNT=50000000 STAKE_AMOUNT=10000000 @@ -158,34 +155,6 @@ setup_file() { assert_equal "$diff" $STAKE_AMOUNT } -@test "[INTEGRATION-BASIC-$CHAIN_NAME] packet forwarding automatically liquid stake and ibc transfer stAsset to original network" { - memo='{ "autopilot": { "receiver": "'"$(STRIDE_ADDRESS)"'", "stakeibc": { "action": "LiquidStake", "ibc_receiver": "'$HOST_VAL_ADDRESS'" } } }' - - # get initial balances - stibctoken_balance_start=$($HOST_MAIN_CMD q bank balances $HOST_VAL_ADDRESS --denom $IBC_GAIA_STATOM_DENOM | GETBAL) - - # Send the IBC transfer with the JSON memo - transfer_msg_prefix="$HOST_MAIN_CMD tx ibc-transfer transfer transfer $HOST_TRANSFER_CHANNEL" - if [[ "$CHAIN_NAME" == "GAIA" ]]; then - # For GAIA (ibc-v3), pass the memo into the receiver field - $transfer_msg_prefix "$memo" ${PACKET_FORWARD_STAKE_AMOUNT}${HOST_DENOM} --from $HOST_VAL -y - elif [[ "$CHAIN_NAME" == "HOST" ]]; then - # For HOST (ibc-v5), pass an address for a receiver and the memo in the --memo field - $transfer_msg_prefix $(STRIDE_ADDRESS) ${PACKET_FORWARD_STAKE_AMOUNT}${HOST_DENOM} --memo "$memo" --from $HOST_VAL -y - else - # For all other hosts, skip this test - skip "Packet forward liquid stake test is only run on GAIA and HOST" - fi - - # Wait for the transfer to complete - WAIT_FOR_BALANCE_CHANGE $CHAIN_NAME $HOST_VAL_ADDRESS $IBC_GAIA_STATOM_DENOM - - # make sure stATOM balance increased - stibctoken_balance_end=$($HOST_MAIN_CMD q bank balances $HOST_VAL_ADDRESS --denom $IBC_GAIA_STATOM_DENOM | GETBAL) - stibctoken_balance_diff=$(($stibctoken_balance_end-$stibctoken_balance_start)) - assert_equal "$stibctoken_balance_diff" "$PACKET_FORWARD_STAKE_AMOUNT" -} - # check that tokens on the host are staked @test "[INTEGRATION-BASIC-$CHAIN_NAME] delegation on $CHAIN_NAME" { # wait for another epoch to pass so that tokens are staked @@ -292,12 +261,9 @@ setup_file() { if [[ "$CHAIN_NAME" == "GAIA" ]]; then # For GAIA (ibc-v3), pass the memo into the receiver field $transfer_msg_prefix "$memo" ${PACKET_FORWARD_STAKE_AMOUNT}${HOST_DENOM} --from $HOST_VAL -y - elif [[ "$CHAIN_NAME" == "HOST" ]]; then - # For HOST (ibc-v5), pass an address for a receiver and the memo in the --memo field - $transfer_msg_prefix $(STRIDE_ADDRESS) ${PACKET_FORWARD_STAKE_AMOUNT}${HOST_DENOM} --memo "$memo" --from $HOST_VAL -y else - # For all other hosts, skip this test - skip "Packet forward liquid stake test is only run on GAIA and HOST" + # For all other hosts (ibc-v5), pass an address for a receiver and the memo in the --memo field + $transfer_msg_prefix $(STRIDE_ADDRESS) ${PACKET_FORWARD_STAKE_AMOUNT}${HOST_DENOM} --memo "$memo" --from $HOST_VAL -y fi # Wait for the transfer to complete @@ -310,10 +276,6 @@ setup_file() { } @test "[INTEGRATION-BASIC-$CHAIN_NAME] autopilot liquid stake and transfer" { - if [[ "$CHAIN_NAME" != "GAIA" && "$CHAIN_NAME" != "HOST" ]]; then - skip "Packet forward liquid stake test is only run on GAIA and HOST" - fi - memo='{ "autopilot": { "receiver": "'"$(STRIDE_ADDRESS)"'", "stakeibc": { "action": "LiquidStake", "ibc_receiver": "'$HOST_VAL_ADDRESS'" } } }' # get initial balances @@ -324,8 +286,8 @@ setup_file() { if [[ "$CHAIN_NAME" == "GAIA" ]]; then # For GAIA (ibc-v3), pass the memo into the receiver field $transfer_msg_prefix "$memo" ${PACKET_FORWARD_STAKE_AMOUNT}${HOST_DENOM} --from $HOST_VAL -y - elif [[ "$CHAIN_NAME" == "HOST" ]]; then - # For HOST (ibc-v5), pass an address for a receiver and the memo in the --memo field + else + # For all other hosts (ibc-v5), pass an address for a receiver and the memo in the --memo field $transfer_msg_prefix $(STRIDE_ADDRESS) ${PACKET_FORWARD_STAKE_AMOUNT}${HOST_DENOM} --memo "$memo" --from $HOST_VAL -y fi @@ -354,12 +316,9 @@ setup_file() { if [[ "$CHAIN_NAME" == "GAIA" ]]; then # For GAIA (ibc-v3), pass the memo into the receiver field $transfer_msg_prefix "$memo" ${REDEEM_AMOUNT}${IBC_STTOKEN} --from $HOST_VAL -y - elif [[ "$CHAIN_NAME" == "HOST" ]]; then - # For HOST (ibc-v5), pass an address for a receiver and the memo in the --memo field - $transfer_msg_prefix $(STRIDE_ADDRESS)${REDEEM_AMOUNT}${IBC_STTOKEN} --memo "$memo" --from $HOST_VAL -y else - # For all other hosts, skip this test - skip "Packet forward liquid stake test is only run on GAIA and HOST" + # For all other hosts (ibc-v5), pass an address for a receiver and the memo in the --memo field + $transfer_msg_prefix $(STRIDE_ADDRESS) ${REDEEM_AMOUNT}${IBC_STTOKEN} --memo "$memo" --from $HOST_VAL -y fi WAIT_FOR_BLOCK $STRIDE_LOGS 2