Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
codchen committed Apr 2, 2024
1 parent 30ed8c5 commit fd1dec3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
34 changes: 17 additions & 17 deletions integration_test/seidb/state_store_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,39 @@
verifiers:
# Verify number of wasm codes at each height
- type: eval
expr: BEGINNING_LIST_CODE_LENGTH == 0
expr: BEGINNING_LIST_CODE_LENGTH == 2
- type: eval
expr: FIRST_SET_LIST_CODE_LENGTH == 10
expr: FIRST_SET_LIST_CODE_LENGTH == 12
- type: eval
expr: FIRST_SET_LIST_CODE_LENGTH_REVERSE == 10
expr: FIRST_SET_LIST_CODE_LENGTH_REVERSE == 12
- type: eval
expr: SECOND_SET_LIST_CODE_LENGTH == 20
expr: SECOND_SET_LIST_CODE_LENGTH == 22
- type: eval
expr: SECOND_SET_LIST_CODE_LENGTH_REVERSE == 20
expr: SECOND_SET_LIST_CODE_LENGTH_REVERSE == 22
- type: eval
expr: THIRD_SET_LIST_CODE_LENGTH == 30
expr: THIRD_SET_LIST_CODE_LENGTH == 32
- type: eval
expr: THIRD_SET_LIST_CODE_LENGTH_REVERSE == 30
expr: THIRD_SET_LIST_CODE_LENGTH_REVERSE == 32

- 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"
- cmd: seid q wasm list-code --count-total --limit 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[3].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 400 --height $FIRST_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[3].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"
- cmd: seid q wasm list-code --reverse --count-total --limit 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[3].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 400 --height $SECOND_SET_BLOCK_HEIGHT --output json | jq -r ".code_infos[3].creator"
env: FIRST_CREATOR_SECOND_SET
# Get creator id
- cmd: tail -1 integration_test/contracts/wasm_creator_id.txt
Expand All @@ -85,9 +85,9 @@
# Verify correct code ids
# NOTE: Since chain is continually running / stateful, may have remove
- type: eval
expr: FIRST_ID_FIRST_SET == 1
expr: FIRST_ID_FIRST_SET == 4
- type: eval
expr: SECOND_ID_FIRST_SET == 20
expr: SECOND_ID_FIRST_SET == 19

- name: Test state store iteration through tokenfactory denoms
inputs:
Expand Down Expand Up @@ -121,10 +121,10 @@
verifiers:
# Verify number of wasm codes at each height
- type: eval
expr: BEGINNING_TFK_DENOMS == 0
expr: BEGINNING_TFK_DENOMS == 2
- type: eval
expr: FIRST_SET_TFK_DENOMS == 10
expr: FIRST_SET_TFK_DENOMS == 12
- type: eval
expr: SECOND_SET_TFK_DENOMS == 20
expr: SECOND_SET_TFK_DENOMS == 22
- type: eval
expr: THIRD_SET_TFK_DENOMS == 30
expr: THIRD_SET_TFK_DENOMS == 32
2 changes: 1 addition & 1 deletion precompiles/wasmd/wasmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestInstantiate(t *testing.T) {
outputs, err := instantiateMethod.Outputs.Unpack(res)
require.Nil(t, err)
require.Equal(t, 2, len(outputs))
require.Equal(t, "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m", outputs[0].(string))
require.Equal(t, "sei1hrpna9v7vs3stzyd4z3xf00676kf78zpe2u5ksvljswn2vnjp3yslucc3n", outputs[0].(string))
require.Empty(t, outputs[1].([]byte))
require.Equal(t, uint64(902898), g)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

const (
TestContractA = "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m"
TestContractA = "sei1hrpna9v7vs3stzyd4z3xf00676kf78zpe2u5ksvljswn2vnjp3yslucc3n"
TestContractB = "sei1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrqms7u8a"
TestContractC = "sei1xr3rq8yvd7qplsw5yx90ftsr2zdhg4e9z60h5duusgxpv72hud3shh3qfl"
TestContractD = "sei1up07dctjqud4fns75cnpejr4frmjtddzsmwgcktlyxd4zekhwecqghxqcp"
Expand Down

0 comments on commit fd1dec3

Please sign in to comment.