diff --git a/x/collection/msgs.go b/x/collection/msgs.go index 71f3c2ec9e..17fc9356e3 100644 --- a/x/collection/msgs.go +++ b/x/collection/msgs.go @@ -428,14 +428,17 @@ func (m MsgAuthorizeOperator) ValidateBasic() error { return err } - if _, err := sdk.AccAddressFromBech32(m.Holder); err != nil { + holderAcc, err := sdk.AccAddressFromBech32(m.Holder) + if err != nil { return sdkerrors.ErrInvalidAddress.Wrapf("invalid holder address: %s", m.Holder) } - if _, err := sdk.AccAddressFromBech32(m.Operator); err != nil { + + operatorAcc, err := sdk.AccAddressFromBech32(m.Operator) + if err != nil { return sdkerrors.ErrInvalidAddress.Wrapf("invalid operator address: %s", m.Operator) } - if m.Operator == m.Holder { + if holderAcc.Equals(operatorAcc) { return ErrApproverProxySame } diff --git a/x/token/msgs.go b/x/token/msgs.go index d3d315aa0a..5029a1be64 100644 --- a/x/token/msgs.go +++ b/x/token/msgs.go @@ -146,14 +146,17 @@ func (m MsgAuthorizeOperator) ValidateBasic() error { return err } - if _, err := sdk.AccAddressFromBech32(m.Holder); err != nil { + holderAcc, err := sdk.AccAddressFromBech32(m.Holder) + if err != nil { return sdkerrors.ErrInvalidAddress.Wrapf("invalid holder address: %s", m.Holder) } - if _, err := sdk.AccAddressFromBech32(m.Operator); err != nil { + + operatorAcc, err := sdk.AccAddressFromBech32(m.Operator) + if err != nil { return sdkerrors.ErrInvalidAddress.Wrapf("invalid operator address: %s", m.Operator) } - if m.Operator == m.Holder { + if holderAcc.Equals(operatorAcc) { return ErrApproverProxySame }