Skip to content

Commit

Permalink
fix: fix the lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gsk967 committed Jun 17, 2024
1 parent e88e32d commit 93fdf14
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions util/ibc/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"strings"

sdkmath "cosmossdk.io/math"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
ibcerrors "github.com/cosmos/ibc-go/v7/modules/core/errors"
)
Expand All @@ -18,8 +17,7 @@ const (

func ValidateRecvAddr(receiver string) error {
if len(receiver) > MaximumReceiverLength {
return sdkerrors.Wrapf(ibcerrors.ErrInvalidAddress,
"recipient address must not exceed %d bytes", MaximumReceiverLength)
return ibcerrors.ErrInvalidAddress.Wrapf("recipient address must not exceed %d bytes", MaximumReceiverLength)
}
return nil
}
Expand Down Expand Up @@ -49,7 +47,7 @@ func GetFundsFromPacket(data []byte) (sdkmath.Int, string, error) {

amount, ok := sdkmath.NewIntFromString(packetData.Amount)
if !ok {
return sdkmath.Int{}, "", sdkerrors.ErrInvalidRequest.Wrapf("invalid transfer amount %s", packetData.Amount)
return sdkmath.Int{}, "", ibcerrors.ErrInvalidRequest.Wrapf("invalid transfer amount %s", packetData.Amount)

Check warning on line 50 in util/ibc/ibc.go

View check run for this annotation

Codecov / codecov/patch

util/ibc/ibc.go#L50

Added line #L50 was not covered by tests
}

return amount, GetLocalDenom(packetData.Denom), nil
Expand Down
2 changes: 1 addition & 1 deletion util/sdkutil/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func GenerateString(length uint) string {
charset := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
bytes := make([]byte, length)
for i := range bytes {
bytes[i] = charset[rand.Intn(len(charset))]
bytes[i] = charset[rand.Intn(len(charset))] //nolint

Check warning on line 40 in util/sdkutil/string.go

View check run for this annotation

Codecov / codecov/patch

util/sdkutil/string.go#L37-L40

Added lines #L37 - L40 were not covered by tests
}
return string(bytes)

Check warning on line 42 in util/sdkutil/string.go

View check run for this annotation

Codecov / codecov/patch

util/sdkutil/string.go#L42

Added line #L42 was not covered by tests
}
2 changes: 1 addition & 1 deletion x/oracle/keeper/historic_price.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (k Keeper) CalcAndSetHistoricMedian(

median, err := decmath.Median(historicPrices)
if err != nil {
return errors.Wrap(err, "denom: "+denom) //nolint: goconst
return errors.Wrap(err, "denom: "+denom)

Check warning on line 48 in x/oracle/keeper/historic_price.go

View check run for this annotation

Codecov / codecov/patch

x/oracle/keeper/historic_price.go#L48

Added line #L48 was not covered by tests
}

block := uint64(ctx.BlockHeight())
Expand Down

0 comments on commit 93fdf14

Please sign in to comment.