diff --git a/x/opchild/ante/fee_utils.go b/x/opchild/ante/fee_utils.go index 3110557..fe4ad90 100644 --- a/x/opchild/ante/fee_utils.go +++ b/x/opchild/ante/fee_utils.go @@ -1,6 +1,7 @@ package ante import ( + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -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()) } } diff --git a/x/opchild/keeper/msg_server.go b/x/opchild/keeper/msg_server.go index 1add4b4..137fbce 100644 --- a/x/opchild/keeper/msg_server.go +++ b/x/opchild/keeper/msg_server.go @@ -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 + } + + return nil, errorsmod.Wrap(types.ErrInvalidSigner, signer) } handler := ms.Router().Handler(msg) diff --git a/x/opchild/keeper/oracle.go b/x/opchild/keeper/oracle.go index ac8b9f0..83350fe 100644 --- a/x/opchild/keeper/oracle.go +++ b/x/opchild/keeper/oracle.go @@ -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 } @@ -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 }