Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Sep 3, 2024
1 parent d070aaa commit b2d9cd2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion x/opchild/ante/fee_utils.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ante

import (
"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
)

Expand All @@ -26,7 +27,7 @@ func computeRequiredFees(gas uint64, minGasPrices sdk.DecCoins) sdk.Coins {
// Determine the required fees by multiplying each required minimum gas
// price by the gas limit, where fee = ceil(minGasPrice * gasLimit).
for i, gp := range minGasPrices {
fee := gp.Amount.MulInt64(int64(gas))
fee := gp.Amount.MulInt(math.NewIntFromUint64(gas))
requiredFees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt())
}
}
Expand Down
7 changes: 6 additions & 1 deletion x/opchild/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ func (ms MsgServer) ExecuteMessages(ctx context.Context, req *types.MsgExecuteMe

// assert that the opchild module account is the only signer for ExecuteMessages message
if !bytes.Equal(signers[0], authority) {
return nil, errorsmod.Wrapf(types.ErrInvalidSigner, sdk.AccAddress(signers[0]).String())
signer, err := ms.addressCodec.BytesToString(signers[0])
if err != nil {
return nil, err
}

Check warning on line 115 in x/opchild/keeper/msg_server.go

View check run for this annotation

Codecov / codecov/patch

x/opchild/keeper/msg_server.go#L112-L115

Added lines #L112 - L115 were not covered by tests

return nil, errorsmod.Wrap(types.ErrInvalidSigner, signer)

Check warning on line 117 in x/opchild/keeper/msg_server.go

View check run for this annotation

Codecov / codecov/patch

x/opchild/keeper/msg_server.go#L117

Added line #L117 was not covered by tests
}

handler := ms.Router().Handler(msg)
Expand Down
6 changes: 4 additions & 2 deletions x/opchild/keeper/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ func (k L2OracleHandler) UpdateOracle(ctx context.Context, height uint64, extCom
return err
}

if hostStoreLastHeight > int64(height) {
//nolint:gosec
h := int64(height)
if hostStoreLastHeight > h {
return types.ErrInvalidOracleHeight
}

Expand All @@ -83,7 +85,7 @@ func (k L2OracleHandler) UpdateOracle(ctx context.Context, height uint64, extCom
return err
}

err = l2slinky.ValidateVoteExtensions(sdkCtx, k.HostValidatorStore, int64(height-1), hostChainID, extendedCommitInfo)
err = l2slinky.ValidateVoteExtensions(sdkCtx, k.HostValidatorStore, h-1, hostChainID, extendedCommitInfo)
if err != nil {
return err
}
Expand Down

0 comments on commit b2d9cd2

Please sign in to comment.