From 7da4d9c539a11f85e2ba0f25af31d16da39dcfb0 Mon Sep 17 00:00:00 2001 From: Vishal Date: Tue, 4 Apr 2023 12:40:39 +0530 Subject: [PATCH] fix: removed unnecessary usage of error type ErrInvalidMsg --- x/wasm/types/errors.go | 2 -- x/wasm/types/tx.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/x/wasm/types/errors.go b/x/wasm/types/errors.go index 832d5d7ffd..378c25d67b 100644 --- a/x/wasm/types/errors.go +++ b/x/wasm/types/errors.go @@ -85,8 +85,6 @@ var ( ErrNoSuchCodeFn = WasmVMFlavouredErrorFactory(errorsmod.Register(DefaultCodespace, 28, "no such code"), func(id uint64) error { return wasmvmtypes.NoSuchCode{CodeID: id} }, ) - // ErrSameAdmin error to show the old admin and new admin are same. - ErrSameAdmin = errorsmod.Register(DefaultCodespace, 29, "new admin is the same as the old") ) // WasmVMErrorable mapped error type in wasmvm and are not redacted diff --git a/x/wasm/types/tx.go b/x/wasm/types/tx.go index 360f70db61..023cfdbc72 100644 --- a/x/wasm/types/tx.go +++ b/x/wasm/types/tx.go @@ -262,7 +262,7 @@ func (msg MsgUpdateAdmin) ValidateBasic() error { return errorsmod.Wrap(err, "new admin") } if strings.EqualFold(msg.Sender, msg.NewAdmin) { - return errorsmod.Wrap(ErrSameAdmin, "new admin is the same as the old") + return errorsmod.Wrap(ErrInvalid, "new admin is the same as the old") } return nil }