Skip to content

Commit db29c6d

Browse files
author
yihuang
authored
Update x/cronos/keeper/msg_server.go
1 parent c5a4a11 commit db29c6d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

x/cronos/keeper/msg_server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ func (k msgServer) TransferTokens(goCtx context.Context, msg *types.MsgTransferT
6262
func (k msgServer) UpdateTokenMapping(goCtx context.Context, msg *types.MsgUpdateTokenMapping) (*types.MsgUpdateTokenMappingResponse, error) {
6363
ctx := sdk.UnwrapSDKContext(goCtx)
6464
admin := k.Keeper.GetParams(ctx).CronosAdmin
65-
if len(admin) > 0 && admin != msg.Sender {
65+
// if admin is empty, no sender could be equal to it
66+
if admin != msg.Sender {
6667
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "msg sender is authorized")
6768
}
6869
// msg is already validated

0 commit comments

Comments
 (0)