From dbd1e35f809781719a56410c78e75b0fd9480a3a Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Tue, 16 Jan 2024 15:55:45 -0800 Subject: [PATCH 01/14] SeiDB State Store Integration Tests --- .github/workflows/integration-test.yml | 8 ++ .../contracts/create_tokenfactory_denoms.sh | 59 ++++++++ .../contracts/deploy_wasm_contracts.sh | 61 ++++++++ integration_test/seidb/state_store_test.yaml | 132 ++++++++++++++++++ 4 files changed, 260 insertions(+) create mode 100755 integration_test/contracts/create_tokenfactory_denoms.sh create mode 100755 integration_test/contracts/deploy_wasm_contracts.sh create mode 100644 integration_test/seidb/state_store_test.yaml diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 61785af0ba..e94eab5140 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -92,6 +92,14 @@ jobs: "python3 integration_test/scripts/runner.py integration_test/upgrade_module/minor_upgrade_test.yaml" ] }, + { + name: "SeiDB State Store", + scripts: [ + "docker exec sei-node-0 integration_test/contracts/deploy_wasm_contracts.sh", + "docker exec sei-node-0 integration_test/contracts/create_tokenfactory_denoms.sh", + "python3 integration_test/scripts/runner.py integration_test/seidb/state_store_test.yaml", + ] + }, ] steps: - uses: actions/checkout@v3 diff --git a/integration_test/contracts/create_tokenfactory_denoms.sh b/integration_test/contracts/create_tokenfactory_denoms.sh new file mode 100755 index 0000000000..0af6d92a32 --- /dev/null +++ b/integration_test/contracts/create_tokenfactory_denoms.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +seidbin=$(which ~/go/bin/seid | tr -d '"') +keyname=$(printf "12345678\n" | $seidbin keys list --output json | jq ".[0].name" | tr -d '"') +chainid=$($seidbin status | jq ".NodeInfo.network" | tr -d '"') +seihome=$(git rev-parse --show-toplevel | tr -d '"') + +cd $seihome || exit +echo "Deploying first set of tokenfactory denoms..." + +beginning_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') +echo "$beginning_block_height" > $seihome/integration_test/contracts/tfk_beginning_block_height.txt +echo "$keyname" > $seihome/integration_test/contracts/tfk_creator_id.txt + +# create first set of tokenfactory denoms +for i in {1..100} +do + echo "Creating first set of tokenfactory denoms #$i..." + create_denom_result=$(printf "12345678\n" | $seidbin tx tokenfactory create-denom "$i" -y --from="$keyname" --chain-id="$chainid" --gas=500000 --fees=100000usei --broadcast-mode=block --output=json) + new_token_denom=$(echo "$create_denom_result" | jq -r '.logs[].events[].attributes[] | select(.key == "new_token_denom").value') + echo "Got token $new_token_denom for iteration $i" +done + + +first_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') +echo "$first_set_block_height" > $seihome/integration_test/contracts/tfk_first_set_block_height.txt + +sleep 20s + +# create second set of tokenfactory denoms +for i in {101..200} +do + echo "Creating first set of tokenfactory denoms #$i..." + create_denom_result=$(printf "12345678\n" | $seidbin tx tokenfactory create-denom "$i" -y --from="$keyname" --chain-id="$chainid" --gas=500000 --fees=100000usei --broadcast-mode=block --output=json) + new_token_denom=$(echo "$create_denom_result" | jq -r '.logs[].events[].attributes[] | select(.key == "new_token_denom").value') + echo "Got token $new_token_denom for iteration $i" +done + +second_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') +echo "$second_set_block_height" > $seihome/integration_test/contracts/tfk_second_set_block_height.txt + +sleep 20s + +# create third set of tokenfactory denoms +for i in {201..300} +do + echo "Creating first set of tokenfactory denoms #$i..." + create_denom_result=$(printf "12345678\n" | $seidbin tx tokenfactory create-denom "$i" -y --from="$keyname" --chain-id="$chainid" --gas=500000 --fees=100000usei --broadcast-mode=block --output=json) + new_token_denom=$(echo "$create_denom_result" | jq -r '.logs[].events[].attributes[] | select(.key == "new_token_denom").value') + echo "Got token $new_token_denom for iteration $i" +done + +third_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') +echo "$third_set_block_height" > $seihome/integration_test/contracts/tfk_third_set_block_height.txt + + +# seid q bank total + +exit 0 diff --git a/integration_test/contracts/deploy_wasm_contracts.sh b/integration_test/contracts/deploy_wasm_contracts.sh new file mode 100755 index 0000000000..51aa3fd948 --- /dev/null +++ b/integration_test/contracts/deploy_wasm_contracts.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +seidbin=$(which ~/go/bin/seid | tr -d '"') +keyname=$(printf "12345678\n" | $seidbin keys list --output json | jq ".[0].name" | tr -d '"') +chainid=$($seidbin status | jq ".NodeInfo.network" | tr -d '"') +seihome=$(git rev-parse --show-toplevel | tr -d '"') + +cd $seihome || exit +echo "Deploying first set of contracts..." + +beginning_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') +echo "$beginning_block_height" > $seihome/integration_test/contracts/wasm_beginning_block_height.txt +echo "$keyname" > $seihome/integration_test/contracts/wasm_creator_id.txt + +# store first set of contracts +for i in {1..100} +do + echo "Storing first set contract #$i..." + store_result=$(printf "12345678\n" | $seidbin tx wasm store integration_test/contracts/mars.wasm -y --from="$keyname" --chain-id="$chainid" --gas=5000000 --fees=1000000usei --broadcast-mode=block --output=json) + contract_id=$(echo "$store_result" | jq -r '.logs[].events[].attributes[] | select(.key == "code_id").value') + printf "12345678\n" | $seidbin tx wasm instantiate "$contract_id" '{}' -y --no-admin --from="$keyname" --chain-id="$chainid" --gas=5000000 --fees=1000000usei --broadcast-mode=block --label=dex --output=json + echo "Got contract id $contract_id for iteration $i" +done + +first_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') +echo "$first_set_block_height" > $seihome/integration_test/contracts/wasm_first_set_block_height.txt + +sleep 20s + +# store second set of contracts +for i in {101..200} +do + echo "Storing second set contract #$i..." + store_result=$(printf "12345678\n" | $seidbin tx wasm store integration_test/contracts/saturn.wasm -y --from="$keyname" --chain-id="$chainid" --gas=5000000 --fees=1000000usei --broadcast-mode=block --output=json) + contract_id=$(echo "$store_result" | jq -r '.logs[].events[].attributes[] | select(.key == "code_id").value') + printf "12345678\n" | $seidbin tx wasm instantiate "$contract_id" '{}' -y --no-admin --from="$keyname" --chain-id="$chainid" --gas=5000000 --fees=1000000usei --broadcast-mode=block --label=dex --output=json + echo "Got contract id $contract_id for iteration $i" +done + +second_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') +echo "$second_set_block_height" > $seihome/integration_test/contracts/wasm_second_set_block_height.txt + +sleep 20s + +# store third set of contracts +for i in {201..300} +do + echo "Storing third set contract #$i..." + store_result=$(printf "12345678\n" | $seidbin tx wasm store integration_test/contracts/venus.wasm -y --from="$keyname" --chain-id="$chainid" --gas=5000000 --fees=1000000usei --broadcast-mode=block --output=json) + contract_id=$(echo "$store_result" | jq -r '.logs[].events[].attributes[] | select(.key == "code_id").value') + printf "12345678\n" | $seidbin tx wasm instantiate "$contract_id" '{}' -y --no-admin --from="$keyname" --chain-id="$chainid" --gas=5000000 --fees=1000000usei --broadcast-mode=block --label=dex --output=json + echo "Got contract id $contract_id for iteration $i" +done + +third_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') +echo "$third_set_block_height" > $seihome/integration_test/contracts/wasm_third_set_block_height.txt + + +# seid q wasm list store + +exit 0 diff --git a/integration_test/seidb/state_store_test.yaml b/integration_test/seidb/state_store_test.yaml new file mode 100644 index 0000000000..c10d47240b --- /dev/null +++ b/integration_test/seidb/state_store_test.yaml @@ -0,0 +1,132 @@ +- name: Test state store iteration through wasm list code + inputs: + # Verify 300 stored wasm contracts + - cmd: seid q wasm list-code --count-total --limit 400 --output json | jq -r '.code_infos | length' + env: WASM_LIST_CODE_LENGTH + # Get height from beginning + - cmd: tail -1 integration_test/contracts/wasm_beginning_block_height.txt + env: BEGINNING_BLOCK_HEIGHT + # Verify 0 stored wasm contracts at beginning height + - cmd: seid q wasm list-code --count-total --limit 400 --height $BEGINNING_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + env: BEGINNING_LIST_CODE_LENGTH + # Get height from first set + - cmd: tail -1 integration_test/contracts/wasm_first_set_block_height.txt + env: FIRST_SET_BLOCK_HEIGHT + # Verify 100 stored wasm contracts at first height + - cmd: seid q wasm list-code --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + env: FIRST_SET_LIST_CODE_LENGTH + # Verify 100 stored wasm contracts at first height reverse + - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + env: FIRST_SET_LIST_CODE_LENGTH_REVERSE + # Get height from second set + - cmd: tail -1 integration_test/contracts/wasm_second_set_block_height.txt + env: SECOND_SET_BLOCK_HEIGHT + # Verify 200 stored wasm contracts at second height + - cmd: seid q wasm list-code --count-total --limit 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + env: SECOND_SET_LIST_CODE_LENGTH + # Verify 200 stored wasm contracts at second height reverse + - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + env: SECOND_SET_LIST_CODE_LENGTH_REVERSE + # Get height from third set + - cmd: tail -1 integration_test/contracts/wasm_third_set_block_height.txt + env: THIRD_SET_BLOCK_HEIGHT + # Verify 300 stored wasm contracts at third height + - cmd: seid q wasm list-code --count-total --limit 400 --height $THIRD_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + env: THIRD_SET_LIST_CODE_LENGTH + # Verify 300 stored wasm contracts at third height reverse + - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $THIRD_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + env: THIRD_SET_LIST_CODE_LENGTH_REVERSE + verifiers: + # Verify number of wasm codes at each height + - type: eval + expr: WASM_LIST_CODE_LENGTH == 300 + - type: eval + expr: BEGINNING_LIST_CODE_LENGTH == 0 + - type: eval + expr: FIRST_SET_LIST_CODE_LENGTH == 100 + - type: eval + expr: FIRST_SET_LIST_CODE_LENGTH_REVERSE == 100 + - type: eval + expr: SECOND_SET_LIST_CODE_LENGTH == 200 + - type: eval + expr: SECOND_SET_LIST_CODE_LENGTH_REVERSE == 200 + - type: eval + expr: THIRD_SET_LIST_CODE_LENGTH == 300 + - type: eval + expr: THIRD_SET_LIST_CODE_LENGTH_REVERSE == 300 + +- name: Test state store historical data checking specific wasm codes + inputs: + # Get height from first set + - cmd: tail -1 integration_test/contracts/wasm_first_set_block_height.txt + env: FIRST_SET_BLOCK_HEIGHT + # Get code id from first contract returned at first set height in forward order (0) + - cmd: seid q wasm list-code --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos[0].code_id' + env: FIRST_ID_FIRST_SET + # Get creator from first contract returned at first set height in forward order + - cmd: seid q wasm list-code --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos[0].creator' + env: FIRST_CREATOR_FIRST_SET + # Get height from second set + - cmd: tail -1 integration_test/contracts/wasm_second_set_block_height.txt + env: SECOND_SET_BLOCK_HEIGHT + # Get code id from first contract returned at second set height in reverse order (200) + - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos[0].code_id' + env: SECOND_ID_FIRST_SET + # Get creator from second contract returned at second set height in reverse order + - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos[0].creator' + env: FIRST_CREATOR_SECOND_SET + # Get creator id + - cmd: tail -1 integration_test/contracts/wasm_creator_id.txt + env: CREATOR_ID + verifiers: + # Verify we have all same creator id + - type: eval + expr: FIRST_CREATOR_FIRST_SET == CREATOR_ID + - type: eval + expr: FIRST_CREATOR_SECOND_SET == CREATOR_ID + # Verify correct code ids + # NOTE: Since chain is continually running / stateful, may have remove + - type: eval + expr: FIRST_ID_FIRST_SET == 0 + - type: eval + expr: SECOND_ID_FIRST_SET == 200 + +- name: Test state store iteration through tokenfactory denoms + inputs: + # Get creator id + - cmd: tail -1 integration_test/contracts/tfk_creator_id.txt + env: CREATOR_ID + # Get height from beginning + - cmd: tail -1 integration_test/contracts/tfk_beginning_block_height.txt + env: BEGINNING_BLOCK_HEIGHT + # Verify 0 tfk denoms created at beginning + - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --output json | jq -r '.denoms | length' + env: BEGINNING_TFK_DENOMS + # Get height from first set + - cmd: tail -1 integration_test/contracts/tfk_first_set_block_height.txt + env: FIRST_SET_BLOCK_HEIGHT + # Verify 100 tfk denoms created at first + - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r '.denoms | length' + env: FIRST_SET_TFK_DENOMS + # Get height from second set + - cmd: tail -1 integration_test/contracts/tfk_second_set_block_height.txt + env: SECOND_SET_BLOCK_HEIGHT + # Verify 200 tfk denoms created at second set + - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r '.denoms | length' + env: SECOND_SET_TFK_DENOMS + # Get height from third set + - cmd: tail -1 integration_test/contracts/tfk_third_set_block_height.txt + env: THIRD_SET_BLOCK_HEIGHT + # Verify 300 tfk denoms created at third set + - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --height $THIRD_SET_BLOCK_HEIGHT --output json | jq -r '.denoms | length' + env: THIRD_SET_TFK_DENOMS + verifiers: + # Verify number of wasm codes at each height + - type: eval + expr: BEGINNING_TFK_DENOMS == 0 + - type: eval + expr: FIRST_SET_TFK_DENOMS == 100 + - type: eval + expr: SECOND_SET_TFK_DENOMS == 200 + - type: eval + expr: THIRD_SET_TFK_DENOMS == 300 From bc1a8125cfbba8603bad2d3be75beb98262eaafa Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Tue, 16 Jan 2024 18:48:38 -0800 Subject: [PATCH 02/14] Update to differences --- integration_test/seidb/state_store_test.yaml | 24 ++++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/integration_test/seidb/state_store_test.yaml b/integration_test/seidb/state_store_test.yaml index c10d47240b..0595f80441 100644 --- a/integration_test/seidb/state_store_test.yaml +++ b/integration_test/seidb/state_store_test.yaml @@ -39,21 +39,17 @@ verifiers: # Verify number of wasm codes at each height - type: eval - expr: WASM_LIST_CODE_LENGTH == 300 + expr: ( FIRST_SET_LIST_CODE_LENGTH - BEGINNING_LIST_CODE_LENGTH ) == 100 - type: eval - expr: BEGINNING_LIST_CODE_LENGTH == 0 + expr: ( FIRST_SET_LIST_CODE_LENGTH_REVERSE - BEGINNING_LIST_CODE_LENGTH ) == 100 - type: eval - expr: FIRST_SET_LIST_CODE_LENGTH == 100 + expr: ( SECOND_SET_LIST_CODE_LENGTH - BEGINNING_LIST_CODE_LENGTH ) == 200 - type: eval - expr: FIRST_SET_LIST_CODE_LENGTH_REVERSE == 100 + expr: ( SECOND_SET_LIST_CODE_LENGTH_REVERSE - BEGINNING_LIST_CODE_LENGTH ) == 200 - type: eval - expr: SECOND_SET_LIST_CODE_LENGTH == 200 + expr: ( THIRD_SET_LIST_CODE_LENGTH - BEGINNING_LIST_CODE_LENGTH ) == 300 - type: eval - expr: SECOND_SET_LIST_CODE_LENGTH_REVERSE == 200 - - type: eval - expr: THIRD_SET_LIST_CODE_LENGTH == 300 - - type: eval - expr: THIRD_SET_LIST_CODE_LENGTH_REVERSE == 300 + expr: ( THIRD_SET_LIST_CODE_LENGTH_REVERSE - BEGINNING_LIST_CODE_LENGTH ) == 300 - name: Test state store historical data checking specific wasm codes inputs: @@ -123,10 +119,8 @@ verifiers: # Verify number of wasm codes at each height - type: eval - expr: BEGINNING_TFK_DENOMS == 0 - - type: eval - expr: FIRST_SET_TFK_DENOMS == 100 + expr: ( FIRST_SET_TFK_DENOMS - BEGINNING_TFK_DENOMS ) == 100 - type: eval - expr: SECOND_SET_TFK_DENOMS == 200 + expr: ( SECOND_SET_TFK_DENOMS - BEGINNING_TFK_DENOMS ) == 200 - type: eval - expr: THIRD_SET_TFK_DENOMS == 300 + expr: ( THIRD_SET_TFK_DENOMS - BEGINNING_TFK_DENOMS ) == 300 From a1c19c0dba9ebed277efd5c0ca3925049d0806e7 Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Tue, 16 Jan 2024 19:17:16 -0800 Subject: [PATCH 03/14] Update num contracts/denoms + jq --- .../contracts/create_tokenfactory_denoms.sh | 10 ++-- .../contracts/deploy_wasm_contracts.sh | 10 ++-- integration_test/seidb/state_store_test.yaml | 54 +++++++++---------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/integration_test/contracts/create_tokenfactory_denoms.sh b/integration_test/contracts/create_tokenfactory_denoms.sh index 0af6d92a32..3f1f74ecf7 100755 --- a/integration_test/contracts/create_tokenfactory_denoms.sh +++ b/integration_test/contracts/create_tokenfactory_denoms.sh @@ -13,7 +13,7 @@ echo "$beginning_block_height" > $seihome/integration_test/contracts/tfk_beginni echo "$keyname" > $seihome/integration_test/contracts/tfk_creator_id.txt # create first set of tokenfactory denoms -for i in {1..100} +for i in {1..200} do echo "Creating first set of tokenfactory denoms #$i..." create_denom_result=$(printf "12345678\n" | $seidbin tx tokenfactory create-denom "$i" -y --from="$keyname" --chain-id="$chainid" --gas=500000 --fees=100000usei --broadcast-mode=block --output=json) @@ -28,7 +28,7 @@ echo "$first_set_block_height" > $seihome/integration_test/contracts/tfk_first_s sleep 20s # create second set of tokenfactory denoms -for i in {101..200} +for i in {201..400} do echo "Creating first set of tokenfactory denoms #$i..." create_denom_result=$(printf "12345678\n" | $seidbin tx tokenfactory create-denom "$i" -y --from="$keyname" --chain-id="$chainid" --gas=500000 --fees=100000usei --broadcast-mode=block --output=json) @@ -42,7 +42,7 @@ echo "$second_set_block_height" > $seihome/integration_test/contracts/tfk_second sleep 20s # create third set of tokenfactory denoms -for i in {201..300} +for i in {401..600} do echo "Creating first set of tokenfactory denoms #$i..." create_denom_result=$(printf "12345678\n" | $seidbin tx tokenfactory create-denom "$i" -y --from="$keyname" --chain-id="$chainid" --gas=500000 --fees=100000usei --broadcast-mode=block --output=json) @@ -53,7 +53,7 @@ done third_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$third_set_block_height" > $seihome/integration_test/contracts/tfk_third_set_block_height.txt - -# seid q bank total +num_denoms=$(seid q tokenfactory denoms-from-creator $CREATOR_ID --output json | jq -r ".denoms | length") +echo $num_denoms exit 0 diff --git a/integration_test/contracts/deploy_wasm_contracts.sh b/integration_test/contracts/deploy_wasm_contracts.sh index 51aa3fd948..4a6e726c33 100755 --- a/integration_test/contracts/deploy_wasm_contracts.sh +++ b/integration_test/contracts/deploy_wasm_contracts.sh @@ -13,7 +13,7 @@ echo "$beginning_block_height" > $seihome/integration_test/contracts/wasm_beginn echo "$keyname" > $seihome/integration_test/contracts/wasm_creator_id.txt # store first set of contracts -for i in {1..100} +for i in {1..200} do echo "Storing first set contract #$i..." store_result=$(printf "12345678\n" | $seidbin tx wasm store integration_test/contracts/mars.wasm -y --from="$keyname" --chain-id="$chainid" --gas=5000000 --fees=1000000usei --broadcast-mode=block --output=json) @@ -28,7 +28,7 @@ echo "$first_set_block_height" > $seihome/integration_test/contracts/wasm_first_ sleep 20s # store second set of contracts -for i in {101..200} +for i in {201..400} do echo "Storing second set contract #$i..." store_result=$(printf "12345678\n" | $seidbin tx wasm store integration_test/contracts/saturn.wasm -y --from="$keyname" --chain-id="$chainid" --gas=5000000 --fees=1000000usei --broadcast-mode=block --output=json) @@ -43,7 +43,7 @@ echo "$second_set_block_height" > $seihome/integration_test/contracts/wasm_secon sleep 20s # store third set of contracts -for i in {201..300} +for i in {401..600} do echo "Storing third set contract #$i..." store_result=$(printf "12345678\n" | $seidbin tx wasm store integration_test/contracts/venus.wasm -y --from="$keyname" --chain-id="$chainid" --gas=5000000 --fees=1000000usei --broadcast-mode=block --output=json) @@ -55,7 +55,7 @@ done third_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$third_set_block_height" > $seihome/integration_test/contracts/wasm_third_set_block_height.txt - -# seid q wasm list store +num_stored=$(seid q wasm list-code --count-total --limit 800 --output json | jq -r ".code_infos | length") +echo $num_stored exit 0 diff --git a/integration_test/seidb/state_store_test.yaml b/integration_test/seidb/state_store_test.yaml index 0595f80441..d05e6e1845 100644 --- a/integration_test/seidb/state_store_test.yaml +++ b/integration_test/seidb/state_store_test.yaml @@ -1,55 +1,55 @@ - name: Test state store iteration through wasm list code inputs: # Verify 300 stored wasm contracts - - cmd: seid q wasm list-code --count-total --limit 400 --output json | jq -r '.code_infos | length' + - cmd: seid q wasm list-code --count-total --limit 800 --output json | jq -r ".code_infos | length" env: WASM_LIST_CODE_LENGTH # Get height from beginning - cmd: tail -1 integration_test/contracts/wasm_beginning_block_height.txt env: BEGINNING_BLOCK_HEIGHT # Verify 0 stored wasm contracts at beginning height - - cmd: seid q wasm list-code --count-total --limit 400 --height $BEGINNING_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + - cmd: seid q wasm list-code --count-total --limit 800 --height $BEGINNING_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: BEGINNING_LIST_CODE_LENGTH # Get height from first set - cmd: tail -1 integration_test/contracts/wasm_first_set_block_height.txt env: FIRST_SET_BLOCK_HEIGHT # Verify 100 stored wasm contracts at first height - - cmd: seid q wasm list-code --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + - cmd: seid q wasm list-code --count-total --limit 800 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: FIRST_SET_LIST_CODE_LENGTH # Verify 100 stored wasm contracts at first height reverse - - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + - cmd: seid q wasm list-code --reverse --count-total --limit 800 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: FIRST_SET_LIST_CODE_LENGTH_REVERSE # Get height from second set - cmd: tail -1 integration_test/contracts/wasm_second_set_block_height.txt env: SECOND_SET_BLOCK_HEIGHT # Verify 200 stored wasm contracts at second height - - cmd: seid q wasm list-code --count-total --limit 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + - cmd: seid q wasm list-code --count-total --limit 800 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: SECOND_SET_LIST_CODE_LENGTH # Verify 200 stored wasm contracts at second height reverse - - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + - cmd: seid q wasm list-code --reverse --count-total --limit 800 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: SECOND_SET_LIST_CODE_LENGTH_REVERSE # Get height from third set - cmd: tail -1 integration_test/contracts/wasm_third_set_block_height.txt env: THIRD_SET_BLOCK_HEIGHT # Verify 300 stored wasm contracts at third height - - cmd: seid q wasm list-code --count-total --limit 400 --height $THIRD_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + - cmd: seid q wasm list-code --count-total --limit 800 --height $THIRD_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: THIRD_SET_LIST_CODE_LENGTH # Verify 300 stored wasm contracts at third height reverse - - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $THIRD_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos | length' + - cmd: seid q wasm list-code --reverse --count-total --limit 800 --height $THIRD_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: THIRD_SET_LIST_CODE_LENGTH_REVERSE verifiers: # Verify number of wasm codes at each height - type: eval - expr: ( FIRST_SET_LIST_CODE_LENGTH - BEGINNING_LIST_CODE_LENGTH ) == 100 + expr: ( FIRST_SET_LIST_CODE_LENGTH - BEGINNING_LIST_CODE_LENGTH ) == 200 - type: eval - expr: ( FIRST_SET_LIST_CODE_LENGTH_REVERSE - BEGINNING_LIST_CODE_LENGTH ) == 100 + expr: ( FIRST_SET_LIST_CODE_LENGTH_REVERSE - BEGINNING_LIST_CODE_LENGTH ) == 200 - type: eval - expr: ( SECOND_SET_LIST_CODE_LENGTH - BEGINNING_LIST_CODE_LENGTH ) == 200 + expr: ( SECOND_SET_LIST_CODE_LENGTH - BEGINNING_LIST_CODE_LENGTH ) == 400 - type: eval - expr: ( SECOND_SET_LIST_CODE_LENGTH_REVERSE - BEGINNING_LIST_CODE_LENGTH ) == 200 + expr: ( SECOND_SET_LIST_CODE_LENGTH_REVERSE - BEGINNING_LIST_CODE_LENGTH ) == 400 - type: eval - expr: ( THIRD_SET_LIST_CODE_LENGTH - BEGINNING_LIST_CODE_LENGTH ) == 300 + expr: ( THIRD_SET_LIST_CODE_LENGTH - BEGINNING_LIST_CODE_LENGTH ) == 600 - type: eval - expr: ( THIRD_SET_LIST_CODE_LENGTH_REVERSE - BEGINNING_LIST_CODE_LENGTH ) == 300 + expr: ( THIRD_SET_LIST_CODE_LENGTH_REVERSE - BEGINNING_LIST_CODE_LENGTH ) == 600 - name: Test state store historical data checking specific wasm codes inputs: @@ -57,19 +57,19 @@ - cmd: tail -1 integration_test/contracts/wasm_first_set_block_height.txt env: FIRST_SET_BLOCK_HEIGHT # Get code id from first contract returned at first set height in forward order (0) - - cmd: seid q wasm list-code --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos[0].code_id' + - cmd: seid q wasm list-code --count-total --limit 800 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[0].code_id" env: FIRST_ID_FIRST_SET # Get creator from first contract returned at first set height in forward order - - cmd: seid q wasm list-code --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos[0].creator' + - cmd: seid q wasm list-code --count-total --limit 800 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[0].creator" env: FIRST_CREATOR_FIRST_SET # Get height from second set - cmd: tail -1 integration_test/contracts/wasm_second_set_block_height.txt env: SECOND_SET_BLOCK_HEIGHT - # Get code id from first contract returned at second set height in reverse order (200) - - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos[0].code_id' + # Get code id from first contract returned at second set height in reverse order (400) + - cmd: seid q wasm list-code --reverse --count-total --limit 800 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[0].code_id" env: SECOND_ID_FIRST_SET # Get creator from second contract returned at second set height in reverse order - - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r '.code_infos[0].creator' + - cmd: seid q wasm list-code --reverse --count-total --limit 800 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[0].creator" env: FIRST_CREATOR_SECOND_SET # Get creator id - cmd: tail -1 integration_test/contracts/wasm_creator_id.txt @@ -85,7 +85,7 @@ - type: eval expr: FIRST_ID_FIRST_SET == 0 - type: eval - expr: SECOND_ID_FIRST_SET == 200 + expr: SECOND_ID_FIRST_SET == 400 - name: Test state store iteration through tokenfactory denoms inputs: @@ -96,31 +96,31 @@ - cmd: tail -1 integration_test/contracts/tfk_beginning_block_height.txt env: BEGINNING_BLOCK_HEIGHT # Verify 0 tfk denoms created at beginning - - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --output json | jq -r '.denoms | length' + - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --output json | jq -r ".denoms | length" env: BEGINNING_TFK_DENOMS # Get height from first set - cmd: tail -1 integration_test/contracts/tfk_first_set_block_height.txt env: FIRST_SET_BLOCK_HEIGHT # Verify 100 tfk denoms created at first - - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r '.denoms | length' + - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".denoms | length" env: FIRST_SET_TFK_DENOMS # Get height from second set - cmd: tail -1 integration_test/contracts/tfk_second_set_block_height.txt env: SECOND_SET_BLOCK_HEIGHT # Verify 200 tfk denoms created at second set - - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r '.denoms | length' + - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".denoms | length" env: SECOND_SET_TFK_DENOMS # Get height from third set - cmd: tail -1 integration_test/contracts/tfk_third_set_block_height.txt env: THIRD_SET_BLOCK_HEIGHT # Verify 300 tfk denoms created at third set - - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --height $THIRD_SET_BLOCK_HEIGHT --output json | jq -r '.denoms | length' + - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --height $THIRD_SET_BLOCK_HEIGHT --output json | jq -r ".denoms | length" env: THIRD_SET_TFK_DENOMS verifiers: # Verify number of wasm codes at each height - type: eval - expr: ( FIRST_SET_TFK_DENOMS - BEGINNING_TFK_DENOMS ) == 100 + expr: ( FIRST_SET_TFK_DENOMS - BEGINNING_TFK_DENOMS ) == 200 - type: eval - expr: ( SECOND_SET_TFK_DENOMS - BEGINNING_TFK_DENOMS ) == 200 + expr: ( SECOND_SET_TFK_DENOMS - BEGINNING_TFK_DENOMS ) == 400 - type: eval - expr: ( THIRD_SET_TFK_DENOMS - BEGINNING_TFK_DENOMS ) == 300 + expr: ( THIRD_SET_TFK_DENOMS - BEGINNING_TFK_DENOMS ) == 600 From 89460cbb921b2b069bd549f73caab6bbf22372a1 Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Tue, 16 Jan 2024 19:32:45 -0800 Subject: [PATCH 04/14] change length --- .../contracts/create_tokenfactory_denoms.sh | 6 +-- .../contracts/deploy_wasm_contracts.sh | 8 +-- integration_test/seidb/state_store_test.yaml | 52 ++++++++++--------- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/integration_test/contracts/create_tokenfactory_denoms.sh b/integration_test/contracts/create_tokenfactory_denoms.sh index 3f1f74ecf7..b869af3d11 100755 --- a/integration_test/contracts/create_tokenfactory_denoms.sh +++ b/integration_test/contracts/create_tokenfactory_denoms.sh @@ -13,7 +13,7 @@ echo "$beginning_block_height" > $seihome/integration_test/contracts/tfk_beginni echo "$keyname" > $seihome/integration_test/contracts/tfk_creator_id.txt # create first set of tokenfactory denoms -for i in {1..200} +for i in {1..100} do echo "Creating first set of tokenfactory denoms #$i..." create_denom_result=$(printf "12345678\n" | $seidbin tx tokenfactory create-denom "$i" -y --from="$keyname" --chain-id="$chainid" --gas=500000 --fees=100000usei --broadcast-mode=block --output=json) @@ -28,7 +28,7 @@ echo "$first_set_block_height" > $seihome/integration_test/contracts/tfk_first_s sleep 20s # create second set of tokenfactory denoms -for i in {201..400} +for i in {101..200} do echo "Creating first set of tokenfactory denoms #$i..." create_denom_result=$(printf "12345678\n" | $seidbin tx tokenfactory create-denom "$i" -y --from="$keyname" --chain-id="$chainid" --gas=500000 --fees=100000usei --broadcast-mode=block --output=json) @@ -42,7 +42,7 @@ echo "$second_set_block_height" > $seihome/integration_test/contracts/tfk_second sleep 20s # create third set of tokenfactory denoms -for i in {401..600} +for i in {201..300} do echo "Creating first set of tokenfactory denoms #$i..." create_denom_result=$(printf "12345678\n" | $seidbin tx tokenfactory create-denom "$i" -y --from="$keyname" --chain-id="$chainid" --gas=500000 --fees=100000usei --broadcast-mode=block --output=json) diff --git a/integration_test/contracts/deploy_wasm_contracts.sh b/integration_test/contracts/deploy_wasm_contracts.sh index 4a6e726c33..d0299dc447 100755 --- a/integration_test/contracts/deploy_wasm_contracts.sh +++ b/integration_test/contracts/deploy_wasm_contracts.sh @@ -13,7 +13,7 @@ echo "$beginning_block_height" > $seihome/integration_test/contracts/wasm_beginn echo "$keyname" > $seihome/integration_test/contracts/wasm_creator_id.txt # store first set of contracts -for i in {1..200} +for i in {1..100} do echo "Storing first set contract #$i..." store_result=$(printf "12345678\n" | $seidbin tx wasm store integration_test/contracts/mars.wasm -y --from="$keyname" --chain-id="$chainid" --gas=5000000 --fees=1000000usei --broadcast-mode=block --output=json) @@ -28,7 +28,7 @@ echo "$first_set_block_height" > $seihome/integration_test/contracts/wasm_first_ sleep 20s # store second set of contracts -for i in {201..400} +for i in {101..200} do echo "Storing second set contract #$i..." store_result=$(printf "12345678\n" | $seidbin tx wasm store integration_test/contracts/saturn.wasm -y --from="$keyname" --chain-id="$chainid" --gas=5000000 --fees=1000000usei --broadcast-mode=block --output=json) @@ -43,7 +43,7 @@ echo "$second_set_block_height" > $seihome/integration_test/contracts/wasm_secon sleep 20s # store third set of contracts -for i in {401..600} +for i in {201..300} do echo "Storing third set contract #$i..." store_result=$(printf "12345678\n" | $seidbin tx wasm store integration_test/contracts/venus.wasm -y --from="$keyname" --chain-id="$chainid" --gas=5000000 --fees=1000000usei --broadcast-mode=block --output=json) @@ -55,7 +55,7 @@ done third_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$third_set_block_height" > $seihome/integration_test/contracts/wasm_third_set_block_height.txt -num_stored=$(seid q wasm list-code --count-total --limit 800 --output json | jq -r ".code_infos | length") +num_stored=$(seid q wasm list-code --count-total --limit 400 --output json | jq -r ".code_infos | length") echo $num_stored exit 0 diff --git a/integration_test/seidb/state_store_test.yaml b/integration_test/seidb/state_store_test.yaml index d05e6e1845..5451951237 100644 --- a/integration_test/seidb/state_store_test.yaml +++ b/integration_test/seidb/state_store_test.yaml @@ -1,55 +1,57 @@ - name: Test state store iteration through wasm list code inputs: # Verify 300 stored wasm contracts - - cmd: seid q wasm list-code --count-total --limit 800 --output json | jq -r ".code_infos | length" + - cmd: seid q wasm list-code --count-total --limit 400 --output json | jq -r ".code_infos | length" env: WASM_LIST_CODE_LENGTH # Get height from beginning - cmd: tail -1 integration_test/contracts/wasm_beginning_block_height.txt env: BEGINNING_BLOCK_HEIGHT # Verify 0 stored wasm contracts at beginning height - - cmd: seid q wasm list-code --count-total --limit 800 --height $BEGINNING_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" + - cmd: seid q wasm list-code --count-total --limit 400 --height $BEGINNING_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: BEGINNING_LIST_CODE_LENGTH # Get height from first set - cmd: tail -1 integration_test/contracts/wasm_first_set_block_height.txt env: FIRST_SET_BLOCK_HEIGHT # Verify 100 stored wasm contracts at first height - - cmd: seid q wasm list-code --count-total --limit 800 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" + - cmd: seid q wasm list-code --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: FIRST_SET_LIST_CODE_LENGTH # Verify 100 stored wasm contracts at first height reverse - - cmd: seid q wasm list-code --reverse --count-total --limit 800 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" + - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: FIRST_SET_LIST_CODE_LENGTH_REVERSE # Get height from second set - cmd: tail -1 integration_test/contracts/wasm_second_set_block_height.txt env: SECOND_SET_BLOCK_HEIGHT # Verify 200 stored wasm contracts at second height - - cmd: seid q wasm list-code --count-total --limit 800 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" + - cmd: seid q wasm list-code --count-total --limit 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: SECOND_SET_LIST_CODE_LENGTH # Verify 200 stored wasm contracts at second height reverse - - cmd: seid q wasm list-code --reverse --count-total --limit 800 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" + - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: SECOND_SET_LIST_CODE_LENGTH_REVERSE # Get height from third set - cmd: tail -1 integration_test/contracts/wasm_third_set_block_height.txt env: THIRD_SET_BLOCK_HEIGHT # Verify 300 stored wasm contracts at third height - - cmd: seid q wasm list-code --count-total --limit 800 --height $THIRD_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" + - cmd: seid q wasm list-code --count-total --limit 400 --height $THIRD_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: THIRD_SET_LIST_CODE_LENGTH # Verify 300 stored wasm contracts at third height reverse - - cmd: seid q wasm list-code --reverse --count-total --limit 800 --height $THIRD_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" + - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $THIRD_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: THIRD_SET_LIST_CODE_LENGTH_REVERSE verifiers: # Verify number of wasm codes at each height - type: eval - expr: ( FIRST_SET_LIST_CODE_LENGTH - BEGINNING_LIST_CODE_LENGTH ) == 200 + expr: BEGINNING_LIST_CODE_LENGTH == 0 - type: eval - expr: ( FIRST_SET_LIST_CODE_LENGTH_REVERSE - BEGINNING_LIST_CODE_LENGTH ) == 200 + expr: FIRST_SET_LIST_CODE_LENGTH == 100 - type: eval - expr: ( SECOND_SET_LIST_CODE_LENGTH - BEGINNING_LIST_CODE_LENGTH ) == 400 + expr: FIRST_SET_LIST_CODE_LENGTH_REVERSE == 100 - type: eval - expr: ( SECOND_SET_LIST_CODE_LENGTH_REVERSE - BEGINNING_LIST_CODE_LENGTH ) == 400 + expr: SECOND_SET_LIST_CODE_LENGTH == 200 - type: eval - expr: ( THIRD_SET_LIST_CODE_LENGTH - BEGINNING_LIST_CODE_LENGTH ) == 600 + expr: SECOND_SET_LIST_CODE_LENGTH_REVERSE == 200 - type: eval - expr: ( THIRD_SET_LIST_CODE_LENGTH_REVERSE - BEGINNING_LIST_CODE_LENGTH ) == 600 + expr: THIRD_SET_LIST_CODE_LENGTH == 300 + - type: eval + expr: THIRD_SET_LIST_CODE_LENGTH_REVERSE == 300 - name: Test state store historical data checking specific wasm codes inputs: @@ -57,19 +59,19 @@ - cmd: tail -1 integration_test/contracts/wasm_first_set_block_height.txt env: FIRST_SET_BLOCK_HEIGHT # Get code id from first contract returned at first set height in forward order (0) - - cmd: seid q wasm list-code --count-total --limit 800 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[0].code_id" + - cmd: seid q wasm list-code --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[0].code_id" env: FIRST_ID_FIRST_SET # Get creator from first contract returned at first set height in forward order - - cmd: seid q wasm list-code --count-total --limit 800 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[0].creator" + - cmd: seid q wasm list-code --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[0].creator" env: FIRST_CREATOR_FIRST_SET # Get height from second set - cmd: tail -1 integration_test/contracts/wasm_second_set_block_height.txt env: SECOND_SET_BLOCK_HEIGHT - # Get code id from first contract returned at second set height in reverse order (400) - - cmd: seid q wasm list-code --reverse --count-total --limit 800 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[0].code_id" + # Get code id from first contract returned at second set height in reverse order (200) + - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[0].code_id" env: SECOND_ID_FIRST_SET # Get creator from second contract returned at second set height in reverse order - - cmd: seid q wasm list-code --reverse --count-total --limit 800 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[0].creator" + - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[0].creator" env: FIRST_CREATOR_SECOND_SET # Get creator id - cmd: tail -1 integration_test/contracts/wasm_creator_id.txt @@ -83,9 +85,9 @@ # Verify correct code ids # NOTE: Since chain is continually running / stateful, may have remove - type: eval - expr: FIRST_ID_FIRST_SET == 0 + expr: FIRST_ID_FIRST_SET == 1 - type: eval - expr: SECOND_ID_FIRST_SET == 400 + expr: SECOND_ID_FIRST_SET == 200 - name: Test state store iteration through tokenfactory denoms inputs: @@ -119,8 +121,10 @@ verifiers: # Verify number of wasm codes at each height - type: eval - expr: ( FIRST_SET_TFK_DENOMS - BEGINNING_TFK_DENOMS ) == 200 + expr: BEGINNING_TFK_DENOMS == 0 + - type: eval + expr: FIRST_SET_TFK_DENOMS == 100 - type: eval - expr: ( SECOND_SET_TFK_DENOMS - BEGINNING_TFK_DENOMS ) == 400 + expr: SECOND_SET_TFK_DENOMS == 200 - type: eval - expr: ( THIRD_SET_TFK_DENOMS - BEGINNING_TFK_DENOMS ) == 600 + expr: THIRD_SET_TFK_DENOMS == 300 From bef6dd105737c321f999b60de710b713cf02d543 Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Tue, 16 Jan 2024 19:36:53 -0800 Subject: [PATCH 05/14] reduce sleeps --- integration_test/contracts/create_tokenfactory_denoms.sh | 4 ++-- integration_test/contracts/deploy_wasm_contracts.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/integration_test/contracts/create_tokenfactory_denoms.sh b/integration_test/contracts/create_tokenfactory_denoms.sh index b869af3d11..0327392307 100755 --- a/integration_test/contracts/create_tokenfactory_denoms.sh +++ b/integration_test/contracts/create_tokenfactory_denoms.sh @@ -25,7 +25,7 @@ done first_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$first_set_block_height" > $seihome/integration_test/contracts/tfk_first_set_block_height.txt -sleep 20s +sleep 5s # create second set of tokenfactory denoms for i in {101..200} @@ -39,7 +39,7 @@ done second_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$second_set_block_height" > $seihome/integration_test/contracts/tfk_second_set_block_height.txt -sleep 20s +sleep 5s # create third set of tokenfactory denoms for i in {201..300} diff --git a/integration_test/contracts/deploy_wasm_contracts.sh b/integration_test/contracts/deploy_wasm_contracts.sh index d0299dc447..3810688c75 100755 --- a/integration_test/contracts/deploy_wasm_contracts.sh +++ b/integration_test/contracts/deploy_wasm_contracts.sh @@ -25,7 +25,7 @@ done first_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$first_set_block_height" > $seihome/integration_test/contracts/wasm_first_set_block_height.txt -sleep 20s +sleep 5s # store second set of contracts for i in {101..200} @@ -40,7 +40,7 @@ done second_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$second_set_block_height" > $seihome/integration_test/contracts/wasm_second_set_block_height.txt -sleep 20s +sleep 5s # store third set of contracts for i in {201..300} From 21a6857089ebe6c111bd722c0ec88546557d5438 Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Tue, 16 Jan 2024 21:52:43 -0800 Subject: [PATCH 06/14] Check reverse --- integration_test/seidb/state_store_test.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integration_test/seidb/state_store_test.yaml b/integration_test/seidb/state_store_test.yaml index 5451951237..46fcd2127f 100644 --- a/integration_test/seidb/state_store_test.yaml +++ b/integration_test/seidb/state_store_test.yaml @@ -15,8 +15,11 @@ # Verify 100 stored wasm contracts at first height - cmd: seid q wasm list-code --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: FIRST_SET_LIST_CODE_LENGTH + # Get height from first set + - cmd: tail -1 integration_test/contracts/wasm_first_set_block_height.txt + env: FIRST_SET_BLOCK_HEIGHT_COPY # Verify 100 stored wasm contracts at first height reverse - - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" + - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT_COPY --output json | jq -r ".code_infos | length" env: FIRST_SET_LIST_CODE_LENGTH_REVERSE # Get height from second set - cmd: tail -1 integration_test/contracts/wasm_second_set_block_height.txt From f1c4a763f06a432ec0e3775eaf587a9f6566632e Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Tue, 16 Jan 2024 22:04:48 -0800 Subject: [PATCH 07/14] logging --- .../contracts/deploy_wasm_contracts.sh | 24 +++++++++++++++++++ integration_test/seidb/state_store_test.yaml | 5 +--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/integration_test/contracts/deploy_wasm_contracts.sh b/integration_test/contracts/deploy_wasm_contracts.sh index 3810688c75..466debab43 100755 --- a/integration_test/contracts/deploy_wasm_contracts.sh +++ b/integration_test/contracts/deploy_wasm_contracts.sh @@ -25,6 +25,14 @@ done first_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$first_set_block_height" > $seihome/integration_test/contracts/wasm_first_set_block_height.txt +forward_first_set=$(seid q wasm list-code --count-total --limit 400 --height $beginning_block_height --output json) +reverse_first_set=$(seid q wasm list-code --reverse --count-total --limit 400 --height $beginning_block_height --output json) + +echo "100 forward first set $forward_first_set" +echo "" +echo "100 reverse first set $reverse_first_set" +echo "" + sleep 5s # store second set of contracts @@ -40,6 +48,14 @@ done second_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$second_set_block_height" > $seihome/integration_test/contracts/wasm_second_set_block_height.txt +forward_first_set=$(seid q wasm list-code --count-total --limit 400 --height $beginning_block_height --output json) +reverse_first_set=$(seid q wasm list-code --reverse --count-total --limit 400 --height $beginning_block_height --output json) + +echo "200 forward first set $forward_first_set" +echo "" +echo "200 reverse first set $reverse_first_set" +echo "" + sleep 5s # store third set of contracts @@ -58,4 +74,12 @@ echo "$third_set_block_height" > $seihome/integration_test/contracts/wasm_third_ num_stored=$(seid q wasm list-code --count-total --limit 400 --output json | jq -r ".code_infos | length") echo $num_stored +forward_first_set=$(seid q wasm list-code --count-total --limit 400 --height $beginning_block_height --output json) +reverse_first_set=$(seid q wasm list-code --reverse --count-total --limit 400 --height $beginning_block_height --output json) + +echo "300 forward first set $forward_first_set" +echo "" +echo "300 reverse first set $reverse_first_set" +echo "" + exit 0 diff --git a/integration_test/seidb/state_store_test.yaml b/integration_test/seidb/state_store_test.yaml index 46fcd2127f..5451951237 100644 --- a/integration_test/seidb/state_store_test.yaml +++ b/integration_test/seidb/state_store_test.yaml @@ -15,11 +15,8 @@ # Verify 100 stored wasm contracts at first height - cmd: seid q wasm list-code --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: FIRST_SET_LIST_CODE_LENGTH - # Get height from first set - - cmd: tail -1 integration_test/contracts/wasm_first_set_block_height.txt - env: FIRST_SET_BLOCK_HEIGHT_COPY # Verify 100 stored wasm contracts at first height reverse - - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT_COPY --output json | jq -r ".code_infos | length" + - cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos | length" env: FIRST_SET_LIST_CODE_LENGTH_REVERSE # Get height from second set - cmd: tail -1 integration_test/contracts/wasm_second_set_block_height.txt From 8ae90424cb7976658aac5dc1b4f164dca2102bdb Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Tue, 16 Jan 2024 22:12:25 -0800 Subject: [PATCH 08/14] Update block height logging --- integration_test/contracts/deploy_wasm_contracts.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/integration_test/contracts/deploy_wasm_contracts.sh b/integration_test/contracts/deploy_wasm_contracts.sh index 466debab43..8f748997bc 100755 --- a/integration_test/contracts/deploy_wasm_contracts.sh +++ b/integration_test/contracts/deploy_wasm_contracts.sh @@ -25,8 +25,8 @@ done first_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$first_set_block_height" > $seihome/integration_test/contracts/wasm_first_set_block_height.txt -forward_first_set=$(seid q wasm list-code --count-total --limit 400 --height $beginning_block_height --output json) -reverse_first_set=$(seid q wasm list-code --reverse --count-total --limit 400 --height $beginning_block_height --output json) +forward_first_set=$(seid q wasm list-code --count-total --limit 400 --height $first_set_block_height --output json) +reverse_first_set=$(seid q wasm list-code --reverse --count-total --limit 400 --height $first_set_block_height --output json) echo "100 forward first set $forward_first_set" echo "" @@ -48,8 +48,8 @@ done second_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$second_set_block_height" > $seihome/integration_test/contracts/wasm_second_set_block_height.txt -forward_first_set=$(seid q wasm list-code --count-total --limit 400 --height $beginning_block_height --output json) -reverse_first_set=$(seid q wasm list-code --reverse --count-total --limit 400 --height $beginning_block_height --output json) +forward_first_set=$(seid q wasm list-code --count-total --limit 400 --height $first_set_block_height --output json) +reverse_first_set=$(seid q wasm list-code --reverse --count-total --limit 400 --height $first_set_block_height --output json) echo "200 forward first set $forward_first_set" echo "" @@ -74,8 +74,8 @@ echo "$third_set_block_height" > $seihome/integration_test/contracts/wasm_third_ num_stored=$(seid q wasm list-code --count-total --limit 400 --output json | jq -r ".code_infos | length") echo $num_stored -forward_first_set=$(seid q wasm list-code --count-total --limit 400 --height $beginning_block_height --output json) -reverse_first_set=$(seid q wasm list-code --reverse --count-total --limit 400 --height $beginning_block_height --output json) +forward_first_set=$(seid q wasm list-code --count-total --limit 400 --height $first_set_block_height --output json) +reverse_first_set=$(seid q wasm list-code --reverse --count-total --limit 400 --height $first_set_block_height --output json) echo "300 forward first set $forward_first_set" echo "" From 9eb2d50e92c21041cc26bbeff1d54a5633d7cf40 Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Tue, 16 Jan 2024 22:17:41 -0800 Subject: [PATCH 09/14] update seid command --- integration_test/contracts/deploy_wasm_contracts.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/integration_test/contracts/deploy_wasm_contracts.sh b/integration_test/contracts/deploy_wasm_contracts.sh index 8f748997bc..6732bbc00c 100755 --- a/integration_test/contracts/deploy_wasm_contracts.sh +++ b/integration_test/contracts/deploy_wasm_contracts.sh @@ -25,8 +25,8 @@ done first_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$first_set_block_height" > $seihome/integration_test/contracts/wasm_first_set_block_height.txt -forward_first_set=$(seid q wasm list-code --count-total --limit 400 --height $first_set_block_height --output json) -reverse_first_set=$(seid q wasm list-code --reverse --count-total --limit 400 --height $first_set_block_height --output json) +forward_first_set=$($seidbin q wasm list-code --count-total --limit 400 --height $first_set_block_height --output json) +reverse_first_set=$($seidbin q wasm list-code --reverse --count-total --limit 400 --height $first_set_block_height --output json) echo "100 forward first set $forward_first_set" echo "" @@ -48,8 +48,8 @@ done second_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$second_set_block_height" > $seihome/integration_test/contracts/wasm_second_set_block_height.txt -forward_first_set=$(seid q wasm list-code --count-total --limit 400 --height $first_set_block_height --output json) -reverse_first_set=$(seid q wasm list-code --reverse --count-total --limit 400 --height $first_set_block_height --output json) +forward_first_set=$($seidbin q wasm list-code --count-total --limit 400 --height $first_set_block_height --output json) +reverse_first_set=$($seidbin q wasm list-code --reverse --count-total --limit 400 --height $first_set_block_height --output json) echo "200 forward first set $forward_first_set" echo "" @@ -74,8 +74,8 @@ echo "$third_set_block_height" > $seihome/integration_test/contracts/wasm_third_ num_stored=$(seid q wasm list-code --count-total --limit 400 --output json | jq -r ".code_infos | length") echo $num_stored -forward_first_set=$(seid q wasm list-code --count-total --limit 400 --height $first_set_block_height --output json) -reverse_first_set=$(seid q wasm list-code --reverse --count-total --limit 400 --height $first_set_block_height --output json) +forward_first_set=$($seidbin q wasm list-code --count-total --limit 400 --height $first_set_block_height --output json) +reverse_first_set=$($seidbin q wasm list-code --reverse --count-total --limit 400 --height $first_set_block_height --output json) echo "300 forward first set $forward_first_set" echo "" From b5756fbd4487c640a6a3e6fbb29eb0df07fbc365 Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Tue, 16 Jan 2024 23:24:17 -0800 Subject: [PATCH 10/14] Update --- integration_test/contracts/deploy_wasm_contracts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_test/contracts/deploy_wasm_contracts.sh b/integration_test/contracts/deploy_wasm_contracts.sh index 6732bbc00c..d4c4e08439 100755 --- a/integration_test/contracts/deploy_wasm_contracts.sh +++ b/integration_test/contracts/deploy_wasm_contracts.sh @@ -80,6 +80,6 @@ reverse_first_set=$($seidbin q wasm list-code --reverse --count-total --limit 40 echo "300 forward first set $forward_first_set" echo "" echo "300 reverse first set $reverse_first_set" -echo "" +echo "done" exit 0 From 3673a59419b1287972488ab08434e09e648344f5 Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Tue, 16 Jan 2024 23:48:31 -0800 Subject: [PATCH 11/14] remove logging --- .../contracts/deploy_wasm_contracts.sh | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/integration_test/contracts/deploy_wasm_contracts.sh b/integration_test/contracts/deploy_wasm_contracts.sh index d4c4e08439..3810688c75 100755 --- a/integration_test/contracts/deploy_wasm_contracts.sh +++ b/integration_test/contracts/deploy_wasm_contracts.sh @@ -25,14 +25,6 @@ done first_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$first_set_block_height" > $seihome/integration_test/contracts/wasm_first_set_block_height.txt -forward_first_set=$($seidbin q wasm list-code --count-total --limit 400 --height $first_set_block_height --output json) -reverse_first_set=$($seidbin q wasm list-code --reverse --count-total --limit 400 --height $first_set_block_height --output json) - -echo "100 forward first set $forward_first_set" -echo "" -echo "100 reverse first set $reverse_first_set" -echo "" - sleep 5s # store second set of contracts @@ -48,14 +40,6 @@ done second_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$second_set_block_height" > $seihome/integration_test/contracts/wasm_second_set_block_height.txt -forward_first_set=$($seidbin q wasm list-code --count-total --limit 400 --height $first_set_block_height --output json) -reverse_first_set=$($seidbin q wasm list-code --reverse --count-total --limit 400 --height $first_set_block_height --output json) - -echo "200 forward first set $forward_first_set" -echo "" -echo "200 reverse first set $reverse_first_set" -echo "" - sleep 5s # store third set of contracts @@ -74,12 +58,4 @@ echo "$third_set_block_height" > $seihome/integration_test/contracts/wasm_third_ num_stored=$(seid q wasm list-code --count-total --limit 400 --output json | jq -r ".code_infos | length") echo $num_stored -forward_first_set=$($seidbin q wasm list-code --count-total --limit 400 --height $first_set_block_height --output json) -reverse_first_set=$($seidbin q wasm list-code --reverse --count-total --limit 400 --height $first_set_block_height --output json) - -echo "300 forward first set $forward_first_set" -echo "" -echo "300 reverse first set $reverse_first_set" -echo "done" - exit 0 From 7e1030c360e81e6ffcb0c901f2847667a2bee889 Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Sun, 21 Jan 2024 17:13:35 -0500 Subject: [PATCH 12/14] Update to branch --- .github/workflows/integration-test.yml | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration_test/contracts/create_tokenfactory_denoms.sh | 3 ++- integration_test/contracts/deploy_wasm_contracts.sh | 3 ++- integration_test/seidb/state_store_test.yaml | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index e94eab5140..b8957d38ec 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -5,9 +5,9 @@ name: Docker Integration Test on: push: - branches: [ "main" ] + branches: [ "SeiDBIntegrationTests" ] pull_request: - branches: [ "main" ] + branches: [ "SeiDBIntegrationTests" ] defaults: run: diff --git a/go.mod b/go.mod index 2c1794248b..e640307703 100644 --- a/go.mod +++ b/go.mod @@ -311,7 +311,7 @@ replace ( github.com/cosmos/iavl => github.com/sei-protocol/sei-iavl v0.1.9 github.com/cosmos/ibc-go/v3 => github.com/sei-protocol/sei-ibc-go/v3 v3.3.0 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - github.com/sei-protocol/sei-db => github.com/sei-protocol/sei-db v0.0.26 + github.com/sei-protocol/sei-db => github.com/sei-protocol/sei-db v0.0.27-0.20240121161813-7f199d873a5b // Latest goleveldb is broken, we have to stick to this version github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.2.37 diff --git a/go.sum b/go.sum index 4545c332e4..dce7bfaae3 100644 --- a/go.sum +++ b/go.sum @@ -1172,8 +1172,8 @@ github.com/sei-protocol/goutils v0.0.2 h1:Bfa7Sv+4CVLNM20QcpvGb81B8C5HkQC/kW1CQp github.com/sei-protocol/goutils v0.0.2/go.mod h1:iYE2DuJfEnM+APPehr2gOUXfuLuPsVxorcDO+Tzq9q8= github.com/sei-protocol/sei-cosmos v0.2.72 h1:pv1J3fBIpVJwYqTV3unRSJ0/krEGDN5bByZLCkPOIG4= github.com/sei-protocol/sei-cosmos v0.2.72/go.mod h1:CykNPmj90YkwBorkvnc05u9k9MBNDHC3h4CIdmq3R98= -github.com/sei-protocol/sei-db v0.0.26 h1:/jC5AZ1aq9+SpYx+VL9HJfLFoW7/KrGN//QyWVqRsqs= -github.com/sei-protocol/sei-db v0.0.26/go.mod h1:F/ZKZA8HJPcUzSZPA8yt6pfwlGriJ4RDR4eHKSGLStI= +github.com/sei-protocol/sei-db v0.0.27-0.20240121161813-7f199d873a5b h1:axb8u4uoaHEnVwQNvx5O9qnt2rJezxlW+16AdB1kgTE= +github.com/sei-protocol/sei-db v0.0.27-0.20240121161813-7f199d873a5b/go.mod h1:F/ZKZA8HJPcUzSZPA8yt6pfwlGriJ4RDR4eHKSGLStI= github.com/sei-protocol/sei-iavl v0.1.9 h1:y4mVYftxLNRs6533zl7N0/Ch+CzRQc04JDfHolIxgBE= github.com/sei-protocol/sei-iavl v0.1.9/go.mod h1:7PfkEVT5dcoQE+s/9KWdoXJ8VVVP1QpYYPLdxlkSXFk= github.com/sei-protocol/sei-ibc-go/v3 v3.3.0 h1:/mjpTuCSEVDJ51nUDSHU92N0bRSwt49r1rmdC/lqgp8= diff --git a/integration_test/contracts/create_tokenfactory_denoms.sh b/integration_test/contracts/create_tokenfactory_denoms.sh index 0327392307..b1089f170e 100755 --- a/integration_test/contracts/create_tokenfactory_denoms.sh +++ b/integration_test/contracts/create_tokenfactory_denoms.sh @@ -2,6 +2,7 @@ seidbin=$(which ~/go/bin/seid | tr -d '"') keyname=$(printf "12345678\n" | $seidbin keys list --output json | jq ".[0].name" | tr -d '"') +keyaddress=$(printf "12345678\n" | $seidbin keys list --output json | jq ".[0].address" | tr -d '"') chainid=$($seidbin status | jq ".NodeInfo.network" | tr -d '"') seihome=$(git rev-parse --show-toplevel | tr -d '"') @@ -10,7 +11,7 @@ echo "Deploying first set of tokenfactory denoms..." beginning_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$beginning_block_height" > $seihome/integration_test/contracts/tfk_beginning_block_height.txt -echo "$keyname" > $seihome/integration_test/contracts/tfk_creator_id.txt +echo "$keyaddress" > $seihome/integration_test/contracts/tfk_creator_id.txt # create first set of tokenfactory denoms for i in {1..100} diff --git a/integration_test/contracts/deploy_wasm_contracts.sh b/integration_test/contracts/deploy_wasm_contracts.sh index 3810688c75..8a6f73053b 100755 --- a/integration_test/contracts/deploy_wasm_contracts.sh +++ b/integration_test/contracts/deploy_wasm_contracts.sh @@ -2,6 +2,7 @@ seidbin=$(which ~/go/bin/seid | tr -d '"') keyname=$(printf "12345678\n" | $seidbin keys list --output json | jq ".[0].name" | tr -d '"') +keyaddress=$(printf "12345678\n" | $seidbin keys list --output json | jq ".[0].address" | tr -d '"') chainid=$($seidbin status | jq ".NodeInfo.network" | tr -d '"') seihome=$(git rev-parse --show-toplevel | tr -d '"') @@ -10,7 +11,7 @@ echo "Deploying first set of contracts..." beginning_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$beginning_block_height" > $seihome/integration_test/contracts/wasm_beginning_block_height.txt -echo "$keyname" > $seihome/integration_test/contracts/wasm_creator_id.txt +echo "$keyaddress" > $seihome/integration_test/contracts/wasm_creator_id.txt # store first set of contracts for i in {1..100} diff --git a/integration_test/seidb/state_store_test.yaml b/integration_test/seidb/state_store_test.yaml index 5451951237..30d66ded77 100644 --- a/integration_test/seidb/state_store_test.yaml +++ b/integration_test/seidb/state_store_test.yaml @@ -98,7 +98,7 @@ - cmd: tail -1 integration_test/contracts/tfk_beginning_block_height.txt env: BEGINNING_BLOCK_HEIGHT # Verify 0 tfk denoms created at beginning - - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --output json | jq -r ".denoms | length" + - cmd: seid q tokenfactory denoms-from-creator $CREATOR_ID --height $BEGINNING_BLOCK_HEIGHT --output json | jq -r ".denoms | length" env: BEGINNING_TFK_DENOMS # Get height from first set - cmd: tail -1 integration_test/contracts/tfk_first_set_block_height.txt From d55b4b8badd59812e98c4a53c8a2b39c3db908b5 Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Mon, 22 Jan 2024 17:30:14 -0500 Subject: [PATCH 13/14] Update bank tests --- .../bank_module/send_funds_test.yaml | 17 +++++++++++++++++ .../contracts/create_tokenfactory_denoms.sh | 4 ++-- .../contracts/deploy_dex_contract.sh | 2 +- .../contracts/deploy_wasm_contracts.sh | 4 ++-- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/integration_test/bank_module/send_funds_test.yaml b/integration_test/bank_module/send_funds_test.yaml index 3b9a7c490a..9947aa2a22 100644 --- a/integration_test/bank_module/send_funds_test.yaml +++ b/integration_test/bank_module/send_funds_test.yaml @@ -11,7 +11,24 @@ # Validate - cmd: seid q bank balances $BANK_TEST_ACC --output json | jq -r .balances[0].amount env: BANK_TEST_BAL + # Get current height + - cmd: seid q block | jq -r ".block.header.height" + env: FIRST_BLOCK_HEIGHT + # Sleep 20s to let chain progress + - cmd: sleep 20 + # Send more funds + - cmd: printf "12345678\n" | seid tx bank send $ADMIN_ACC $BANK_TEST_ACC 1sei -b block --fees 2000usei --chain-id sei -y + # Verify historical balance correct + - cmd: seid q bank balances $BANK_TEST_ACC --height $FIRST_BLOCK_HEIGHT --output json | jq -r .balances[0].amount + env: FIRST_BANK_TEST_BAL + # Validate + - cmd: seid q bank balances $BANK_TEST_ACC --output json | jq -r .balances[0].amount + env: SECOND_BANK_TEST_BAL verifiers: # Bank balance should be 1sei - type: eval expr: BANK_TEST_BAL == 1000000 + - type: eval + expr: FIRST_BANK_TEST_BAL == 1000000 + - type: eval + expr: SECOND_BANK_TEST_BAL == 2000000 diff --git a/integration_test/contracts/create_tokenfactory_denoms.sh b/integration_test/contracts/create_tokenfactory_denoms.sh index b1089f170e..54f068859d 100755 --- a/integration_test/contracts/create_tokenfactory_denoms.sh +++ b/integration_test/contracts/create_tokenfactory_denoms.sh @@ -26,7 +26,7 @@ done first_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$first_set_block_height" > $seihome/integration_test/contracts/tfk_first_set_block_height.txt -sleep 5s +sleep 5 # create second set of tokenfactory denoms for i in {101..200} @@ -40,7 +40,7 @@ done second_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$second_set_block_height" > $seihome/integration_test/contracts/tfk_second_set_block_height.txt -sleep 5s +sleep 5 # create third set of tokenfactory denoms for i in {201..300} diff --git a/integration_test/contracts/deploy_dex_contract.sh b/integration_test/contracts/deploy_dex_contract.sh index b8f3ee06ad..73878762fa 100755 --- a/integration_test/contracts/deploy_dex_contract.sh +++ b/integration_test/contracts/deploy_dex_contract.sh @@ -46,7 +46,7 @@ contract_pair=$(printf "12345678\n" | $seidbin tx dex register-pairs integration rm -rf integration_test/contracts/"$contract_name"-pair.json -sleep 10s +sleep 10 echo "Deployed contracts:" echo "$contract_addr" diff --git a/integration_test/contracts/deploy_wasm_contracts.sh b/integration_test/contracts/deploy_wasm_contracts.sh index 8a6f73053b..f173b1de79 100755 --- a/integration_test/contracts/deploy_wasm_contracts.sh +++ b/integration_test/contracts/deploy_wasm_contracts.sh @@ -26,7 +26,7 @@ done first_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$first_set_block_height" > $seihome/integration_test/contracts/wasm_first_set_block_height.txt -sleep 5s +sleep 5 # store second set of contracts for i in {101..200} @@ -41,7 +41,7 @@ done second_set_block_height=$($seidbin status | jq -r '.SyncInfo.latest_block_height') echo "$second_set_block_height" > $seihome/integration_test/contracts/wasm_second_set_block_height.txt -sleep 5s +sleep 5 # store third set of contracts for i in {201..300} From e0a521f4746a935c92201c4dc1b5dc772daed7df Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Tue, 23 Jan 2024 18:26:16 -0500 Subject: [PATCH 14/14] Point to latest seidb --- .github/workflows/integration-test.yml | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration_test/bank_module/send_funds_test.yaml | 15 ++++++++++++--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index b8957d38ec..e94eab5140 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -5,9 +5,9 @@ name: Docker Integration Test on: push: - branches: [ "SeiDBIntegrationTests" ] + branches: [ "main" ] pull_request: - branches: [ "SeiDBIntegrationTests" ] + branches: [ "main" ] defaults: run: diff --git a/go.mod b/go.mod index e640307703..729dcdde1d 100644 --- a/go.mod +++ b/go.mod @@ -311,7 +311,7 @@ replace ( github.com/cosmos/iavl => github.com/sei-protocol/sei-iavl v0.1.9 github.com/cosmos/ibc-go/v3 => github.com/sei-protocol/sei-ibc-go/v3 v3.3.0 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - github.com/sei-protocol/sei-db => github.com/sei-protocol/sei-db v0.0.27-0.20240121161813-7f199d873a5b + github.com/sei-protocol/sei-db => github.com/sei-protocol/sei-db v0.0.27 // Latest goleveldb is broken, we have to stick to this version github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.2.37 diff --git a/go.sum b/go.sum index dce7bfaae3..25755d47a4 100644 --- a/go.sum +++ b/go.sum @@ -1172,8 +1172,8 @@ github.com/sei-protocol/goutils v0.0.2 h1:Bfa7Sv+4CVLNM20QcpvGb81B8C5HkQC/kW1CQp github.com/sei-protocol/goutils v0.0.2/go.mod h1:iYE2DuJfEnM+APPehr2gOUXfuLuPsVxorcDO+Tzq9q8= github.com/sei-protocol/sei-cosmos v0.2.72 h1:pv1J3fBIpVJwYqTV3unRSJ0/krEGDN5bByZLCkPOIG4= github.com/sei-protocol/sei-cosmos v0.2.72/go.mod h1:CykNPmj90YkwBorkvnc05u9k9MBNDHC3h4CIdmq3R98= -github.com/sei-protocol/sei-db v0.0.27-0.20240121161813-7f199d873a5b h1:axb8u4uoaHEnVwQNvx5O9qnt2rJezxlW+16AdB1kgTE= -github.com/sei-protocol/sei-db v0.0.27-0.20240121161813-7f199d873a5b/go.mod h1:F/ZKZA8HJPcUzSZPA8yt6pfwlGriJ4RDR4eHKSGLStI= +github.com/sei-protocol/sei-db v0.0.27 h1:IdmzGavY5yP6T2sAM+wLOISTPd+AXp0S5aLmzpozC7c= +github.com/sei-protocol/sei-db v0.0.27/go.mod h1:F/ZKZA8HJPcUzSZPA8yt6pfwlGriJ4RDR4eHKSGLStI= github.com/sei-protocol/sei-iavl v0.1.9 h1:y4mVYftxLNRs6533zl7N0/Ch+CzRQc04JDfHolIxgBE= github.com/sei-protocol/sei-iavl v0.1.9/go.mod h1:7PfkEVT5dcoQE+s/9KWdoXJ8VVVP1QpYYPLdxlkSXFk= github.com/sei-protocol/sei-ibc-go/v3 v3.3.0 h1:/mjpTuCSEVDJ51nUDSHU92N0bRSwt49r1rmdC/lqgp8= diff --git a/integration_test/bank_module/send_funds_test.yaml b/integration_test/bank_module/send_funds_test.yaml index 9947aa2a22..aae39cf2aa 100644 --- a/integration_test/bank_module/send_funds_test.yaml +++ b/integration_test/bank_module/send_funds_test.yaml @@ -6,10 +6,14 @@ env: ADMIN_ACC - cmd: seid keys show -a bank-test --keyring-backend test env: BANK_TEST_ACC + - cmd: seid q block | jq -r ".block.header.height" + env: BEGINNING_BLOCK_HEIGHT + - cmd: seid q bank balances $ADMIN_ACC --denom usei --output json | jq -r .amount + env: BEGINNING_ADMIN_BALANCE # Send funds - cmd: printf "12345678\n" | seid tx bank send $ADMIN_ACC $BANK_TEST_ACC 1sei -b block --fees 2000usei --chain-id sei -y # Validate - - cmd: seid q bank balances $BANK_TEST_ACC --output json | jq -r .balances[0].amount + - cmd: seid q bank balances $BANK_TEST_ACC --denom usei --output json | jq -r .amount env: BANK_TEST_BAL # Get current height - cmd: seid q block | jq -r ".block.header.height" @@ -19,11 +23,14 @@ # Send more funds - cmd: printf "12345678\n" | seid tx bank send $ADMIN_ACC $BANK_TEST_ACC 1sei -b block --fees 2000usei --chain-id sei -y # Verify historical balance correct - - cmd: seid q bank balances $BANK_TEST_ACC --height $FIRST_BLOCK_HEIGHT --output json | jq -r .balances[0].amount + - cmd: seid q bank balances $BANK_TEST_ACC --denom usei --height $FIRST_BLOCK_HEIGHT --output json | jq -r .amount env: FIRST_BANK_TEST_BAL # Validate - - cmd: seid q bank balances $BANK_TEST_ACC --output json | jq -r .balances[0].amount + - cmd: seid q bank balances $BANK_TEST_ACC --denom usei --output json | jq -r .amount env: SECOND_BANK_TEST_BAL + # Validate original admin balance historical query + - cmd: seid q bank balances $ADMIN_ACC --height $BEGINNING_BLOCK_HEIGHT --denom usei --output json | jq -r .amount + env: HISTORICAL_ADMIN_BANK_TEST_BAL verifiers: # Bank balance should be 1sei - type: eval @@ -32,3 +39,5 @@ expr: FIRST_BANK_TEST_BAL == 1000000 - type: eval expr: SECOND_BANK_TEST_BAL == 2000000 + - type: eval + expr: BEGINNING_ADMIN_BALANCE == HISTORICAL_ADMIN_BANK_TEST_BAL