diff --git a/modules/light-clients/08-wasm/types/types_test.go b/modules/light-clients/08-wasm/types/types_test.go index 2548c1fb5237..79ddb3b1c5dc 100644 --- a/modules/light-clients/08-wasm/types/types_test.go +++ b/modules/light-clients/08-wasm/types/types_test.go @@ -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() {