Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aljo242 committed Jul 2, 2024
1 parent 53649a7 commit 4810c2c
Show file tree
Hide file tree
Showing 13 changed files with 258 additions and 259 deletions.
12 changes: 1 addition & 11 deletions abci/checktx/mempool_parity_check_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (m MempoolParityCheckTx) CheckTx() CheckTx {
)

return sdkerrors.ResponseCheckTxWithEvents(
fmt.Errorf("tx size exceeds max bytes for lane %s", lane.Name),
fmt.Errorf("tx size exceeds max bytes for lane %s", lane.Name()),
0,
0,
nil,
Expand Down Expand Up @@ -184,16 +184,6 @@ func (m MempoolParityCheckTx) GetContextForTx(req *cmtabci.RequestCheckTx) sdk.C
}
ctx, _ := sdk.NewContext(ms, header, true, m.baseApp.Logger()).CacheContext()

// Set the context to the correct checking mode.
switch req.Type {
case cmtabci.CheckTxType_New:
ctx = ctx.WithIsCheckTx(true)
case cmtabci.CheckTxType_Recheck:
ctx = ctx.WithIsReCheckTx(true)
default:
panic("unknown check tx type")
}

// Set the remaining important context values.
ctx = ctx.
WithTxBytes(req.Tx).
Expand Down
2 changes: 1 addition & 1 deletion abci/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (s *ProposalsTestSuite) setUpAnteHandler(expectedExecution map[sdk.Tx]bool)
txCache[hashStr] = pass
}

anteHandler := func(ctx sdk.Context, tx sdk.Tx, simulate bool) (newCtx sdk.Context, err error) {
anteHandler := func(ctx sdk.Context, tx sdk.Tx, _ bool) (newCtx sdk.Context, err error) {
bz, err := s.encodingConfig.TxConfig.TxEncoder()(tx)
s.Require().NoError(err)

Expand Down
4 changes: 2 additions & 2 deletions block/base/tx_priority.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
// DefaultTxPriority
func DefaultTxPriority() TxPriority[int] {
return TxPriority[int]{
GetTxPriority: func(goCtx context.Context, tx sdk.Tx) int {
GetTxPriority: func(_ context.Context, _ sdk.Tx) int {
return 0
},
Compare: func(a, b int) int {
Compare: func(_, _ int) int {
return 0
},
MinValue: 0,
Expand Down
2 changes: 1 addition & 1 deletion block/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type (
// NoOpPrepareLanesHandler returns a no-op prepare lanes handler.
// This should only be used for testing.
func NoOpPrepareLanesHandler() PrepareLanesHandler {
return func(ctx sdk.Context, proposal proposals.Proposal) (proposals.Proposal, error) {
return func(_ sdk.Context, proposal proposals.Proposal) (proposals.Proposal, error) {
return proposal, nil
}
}
Expand Down
151 changes: 75 additions & 76 deletions go.mod

Large diffs are not rendered by default.

320 changes: 165 additions & 155 deletions go.sum

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions lanes/base/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ func (s *BaseTestSuite) TestPrepareLane() {
)
s.Require().NoError(err)

mh := func(ctx sdk.Context, tx sdk.Tx) bool {
mh := func(_ sdk.Context, _ sdk.Tx) bool {
return true
}

Expand Down Expand Up @@ -1043,7 +1043,7 @@ func (s *BaseTestSuite) TestProcessLane() {
s.Require().NoError(err)

// First lane matches this lane the other does not.
mh := func(ctx sdk.Context, tx sdk.Tx) bool {
mh := func(_ sdk.Context, tx sdk.Tx) bool {
return tx == tx1
}

Expand Down Expand Up @@ -1301,7 +1301,7 @@ func (s *BaseTestSuite) TestProcessLane() {
tx4,
}

mh := func(ctx sdk.Context, tx sdk.Tx) bool {
mh := func(_ sdk.Context, tx sdk.Tx) bool {
if tx == tx1 || tx == tx2 {
return false
}
Expand Down Expand Up @@ -1387,7 +1387,7 @@ func (s *BaseTestSuite) TestProcessLane() {
tx4,
}

mh := func(ctx sdk.Context, tx sdk.Tx) bool {
mh := func(_ sdk.Context, _ sdk.Tx) bool {
return true
}

Expand Down Expand Up @@ -1462,7 +1462,7 @@ func (s *BaseTestSuite) TestProcessLane() {
tx4,
}

mh := func(ctx sdk.Context, tx sdk.Tx) bool {
mh := func(_ sdk.Context, tx sdk.Tx) bool {
if tx == tx1 || tx == tx3 {
return false
}
Expand Down Expand Up @@ -1680,7 +1680,7 @@ func (s *BaseTestSuite) setUpAnteHandler(expectedExecution map[sdk.Tx]bool) sdk.
txCache[hashStr] = pass
}

anteHandler := func(ctx sdk.Context, tx sdk.Tx, simulate bool) (newCtx sdk.Context, err error) {
anteHandler := func(ctx sdk.Context, tx sdk.Tx, _ bool) (newCtx sdk.Context, err error) {
bz, err := s.encodingConfig.TxConfig.TxEncoder()(tx)
s.Require().NoError(err)

Expand Down
2 changes: 1 addition & 1 deletion lanes/free/lane.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func NewFreeLane[C comparable](
// default implementation matches transactions that are staking related. In particular,
// any transaction that is a MsgDelegate, MsgBeginRedelegate, or MsgCancelUnbondingDelegation.
func DefaultMatchHandler() base.MatchHandler {
return func(ctx sdk.Context, tx sdk.Tx) bool {
return func(_ sdk.Context, tx sdk.Tx) bool {
for _, msg := range tx.GetMsgs() {
switch msg.(type) {
case *types.MsgDelegate:
Expand Down
2 changes: 1 addition & 1 deletion lanes/mev/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (config *DefaultAuctionFactory) GetTimeoutHeight(tx sdk.Tx) (uint64, error)

// MatchHandler defines a default function that checks if a transaction matches the mev lane.
func (config *DefaultAuctionFactory) MatchHandler() base.MatchHandler {
return func(ctx sdk.Context, tx sdk.Tx) bool {
return func(_ sdk.Context, tx sdk.Tx) bool {
bidInfo, err := config.GetAuctionBidInfo(tx)
return bidInfo != nil && err == nil
}
Expand Down
2 changes: 1 addition & 1 deletion lanes/mev/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
// is to be used in the mev index only.
func TxPriority(config Factory) base.TxPriority[string] {
return base.TxPriority[string]{
GetTxPriority: func(goCtx context.Context, tx sdk.Tx) string {
GetTxPriority: func(_ context.Context, tx sdk.Tx) string {
bidInfo, err := config.GetAuctionBidInfo(tx)
if err != nil || bidInfo == nil || bidInfo.Bid.IsNil() {
return ""
Expand Down
4 changes: 2 additions & 2 deletions lanes/mev/testutils/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (s *MEVLaneTestSuiteBase) InitLane(
factory := mev.NewDefaultAuctionFactory(s.EncCfg.TxConfig.TxDecoder(), signer_extraction.NewDefaultAdapter())
matchHandler := factory.MatchHandler()
if matchAll {
matchHandler = func(ctx sdk.Context, tx sdk.Tx) bool {
matchHandler = func(_ sdk.Context, _ sdk.Tx) bool {
return true
}
}
Expand All @@ -80,7 +80,7 @@ func (s *MEVLaneTestSuiteBase) SetUpAnteHandler(expectedExecution map[sdk.Tx]boo
txCache[hashStr] = pass
}

anteHandler := func(ctx sdk.Context, tx sdk.Tx, simulate bool) (newCtx sdk.Context, err error) {
anteHandler := func(ctx sdk.Context, tx sdk.Tx, _ bool) (newCtx sdk.Context, err error) {
bz, err := s.EncCfg.TxConfig.TxEncoder()(tx)
s.Require().NoError(err)

Expand Down
2 changes: 1 addition & 1 deletion tests/app/testappd/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func addTestnetFlagsToCmd(cmd *cobra.Command) {
cmd.Flags().String(flags.FlagKeyType, string(hd.Secp256k1Type), "Key signing algorithm to generate keys for")

// support old flags name for backwards compatibility
cmd.Flags().SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName {
cmd.Flags().SetNormalizeFunc(func(_ *pflag.FlagSet, name string) pflag.NormalizedName {
if name == "algo" {
name = flags.FlagKeyType
}
Expand Down
2 changes: 1 addition & 1 deletion x/auction/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func CmdQueryParams() *cobra.Command {
Use: "params",
Short: "Query the current parameters of the auction module",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
Expand Down

0 comments on commit 4810c2c

Please sign in to comment.