Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Dec 5, 2023
1 parent 68ddb20 commit e5369f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewValidateMsgTransferDecorator() ValidateMsgTransferDecorator {
}

func (vtd ValidateMsgTransferDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
// avoid breaking consensus
// avoid breaking consensus
if !ctx.IsCheckTx() {
return next(ctx, tx, simulate)
}
Expand All @@ -84,21 +84,21 @@ func (vtd ValidateMsgTransferDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, s
}

if len(transfer.ClassId) > MaxClassIDLength {
return ctx, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "class id length must be less than %d", MaxClassIDLength)
return ctx, newsdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "class id length must be less than %d", MaxClassIDLength)
}

Check warning on line 88 in app/ante.go

View check run for this annotation

Codecov / codecov/patch

app/ante.go#L87-L88

Added lines #L87 - L88 were not covered by tests

if len(transfer.TokenIds) > MaxTokenIds {
return ctx, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "token id length must be less than %d", MaxTokenIds)
return ctx, newsdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "token id length must be less than %d", MaxTokenIds)
}

Check warning on line 92 in app/ante.go

View check run for this annotation

Codecov / codecov/patch

app/ante.go#L91-L92

Added lines #L91 - L92 were not covered by tests

for _, tokenID := range transfer.TokenIds {
if len(tokenID) > MaxTokenIDLength {
return ctx, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "token id length must be less than %d", MaxTokenIDLength)
return ctx, newsdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "token id length must be less than %d", MaxTokenIDLength)
}

Check warning on line 97 in app/ante.go

View check run for this annotation

Codecov / codecov/patch

app/ante.go#L96-L97

Added lines #L96 - L97 were not covered by tests
}

if len(transfer.Receiver) > MaximumReceiverLength {
return ctx, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "receiver length must be less than %d", MaximumReceiverLength)
return ctx, newsdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "receiver length must be less than %d", MaximumReceiverLength)
}
}

Expand Down

0 comments on commit e5369f8

Please sign in to comment.