Skip to content

Commit

Permalink
chore: update golangci to v1.61.0
Browse files Browse the repository at this point in the history
Also fix the new issues identified by the update.
  • Loading branch information
Thomasvdam committed Sep 18, 2024
1 parent c9c4c2d commit 3293a2e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ fmt:
### Linting ###
###############################################################################

golangci_version=v1.60.3
golangci_version=v1.61.0

lint-install:
@echo "--> Installing golangci-lint $(golangci_version)"
Expand Down
16 changes: 10 additions & 6 deletions x/randomness/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (h *ProposalHandler) PrepareProposalHandler(

var maxBlockGas uint64
if b := ctx.ConsensusParams().Block; b != nil {
//nolint:gosec // G115: We should always have a gas limit for blocks.
maxBlockGas = uint64(b.MaxGas)
}

Expand Down Expand Up @@ -93,7 +94,9 @@ func (h *ProposalHandler) PrepareProposalHandler(
return nil, err
}

stop := h.txSelector.SelectTxForProposal(ctx, uint64(req.MaxTxBytes), maxBlockGas, newSeedTx, newSeedTxBz)
//nolint:gosec // G115: We should always have a bytes limit for transactions
maxTxBytes := uint64(req.MaxTxBytes)
stop := h.txSelector.SelectTxForProposal(ctx, maxTxBytes, maxBlockGas, newSeedTx, newSeedTxBz)
if stop {
return nil, types.ErrNewSeedTxNotIncluded
}
Expand All @@ -111,7 +114,7 @@ func (h *ProposalHandler) PrepareProposalHandler(
continue
}

stop := h.txSelector.SelectTxForProposal(ctx, uint64(req.MaxTxBytes), maxBlockGas, tx, txBz)
stop := h.txSelector.SelectTxForProposal(ctx, maxTxBytes, maxBlockGas, tx, txBz)
if stop {
break
}
Expand All @@ -130,9 +133,10 @@ func (h *ProposalHandler) ProcessProposalHandler(
) sdk.ProcessProposalHandler {
return func(ctx sdk.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) {
var totalTxGas uint64
var maxBlockGas int64
var maxBlockGas uint64
if b := ctx.ConsensusParams().Block; b != nil {
maxBlockGas = b.MaxGas
//nolint:gosec // G115: We should always have a gas limit for blocks.
maxBlockGas = uint64(b.MaxGas)
}

// process the NewSeed tx
Expand All @@ -147,7 +151,7 @@ func (h *ProposalHandler) ProcessProposalHandler(
totalTxGas += gasTx.GetGas()
}

if totalTxGas > uint64(maxBlockGas) {
if totalTxGas > maxBlockGas {
return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, err
}
}
Expand Down Expand Up @@ -216,7 +220,7 @@ func (h *ProposalHandler) ProcessProposalHandler(
totalTxGas += gasTx.GetGas()
}

if totalTxGas > uint64(maxBlockGas) {
if totalTxGas > maxBlockGas {
return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, err
}
}
Expand Down
5 changes: 3 additions & 2 deletions x/tally/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ func (k Keeper) ProcessTallies(ctx sdk.Context) error {
sudoMsg := types.Sudo{
ID: req.ID,
Result: types.DataResult{
Version: req.Version,
ID: req.ID,
Version: req.Version,
ID: req.ID,
//nolint:gosec // G115: We shouldn't get negative block heights anwyay...
BlockHeight: uint64(ctx.BlockHeight()),
GasUsed: "0", // TODO
PaybackAddress: req.PaybackAddress,
Expand Down
1 change: 0 additions & 1 deletion x/tally/types/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package types
import (
"bytes"
"encoding/binary"

"slices"

"golang.org/x/exp/constraints"
Expand Down

0 comments on commit 3293a2e

Please sign in to comment.