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 4247dce
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion modules/light-clients/08-wasm/types/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,19 @@ 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")
msgUpdate = wasmtypes.NewMsgUpdateWasmCodeId(signer, newCodeId, "invalid\n")
_, 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)
}
Expand Down

0 comments on commit 4247dce

Please sign in to comment.