Skip to content

Commit

Permalink
add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarkushin committed Sep 23, 2023
1 parent ed35119 commit 240bae5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/light-clients/08-wasm/types/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,21 @@ func (suite *WasmTestSuite) TestUpdateWasmCodeIdWithErrors() {
_, err = suite.wasmKeeper.UpdateWasmCodeId(suite.ctx, msgUpdate)
suite.Require().Error(err)

// test non-existing code id
nonExistingCodeId := make([]byte, 32)
msgUpdate = wasmtypes.NewMsgUpdateWasmCodeId(signer, nonExistingCodeId, "08-wasm-0")
_, err = suite.wasmKeeper.UpdateWasmCodeId(suite.ctx, msgUpdate)
suite.Require().Error(err)

// test invalid client id
msgUpdate = wasmtypes.NewMsgUpdateWasmCodeId(signer, newCodeId, "invalid")
_, err = suite.wasmKeeper.UpdateWasmCodeId(suite.ctx, msgUpdate)
suite.Require().Error(err)

// test non-existing client id
msgUpdate = wasmtypes.NewMsgUpdateWasmCodeId(signer, newCodeId, "00-nonexist")
_, err = suite.wasmKeeper.UpdateWasmCodeId(suite.ctx, msgUpdate)
suite.Require().Error(err)
}

func (suite *WasmTestSuite) TestQueryWasmCode() {
Expand Down

0 comments on commit 240bae5

Please sign in to comment.