Skip to content

Commit

Permalink
Satisfy linter
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Pavlovic <matopavlovic@gmail.com>
  • Loading branch information
matejpavlovic committed Feb 10, 2024
1 parent 3a93345 commit ca84cbe
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion codegen/generators/dsl-gen/generator/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ func generateDslFunctionForHandlingSimpleEvent(eventNode *events.EventNode, upon

func GetDslOriginOption(origin *events.Origin) (*types.OneofOption, bool) {
return sliceutil.Any(
sliceutil.Filter(origin.TypeOneof.Options, func(i int, opt *types.OneofOption) bool {
sliceutil.Filter(origin.TypeOneof.Options, func(_ int, opt *types.OneofOption) bool {
return opt.Name() == "Dsl"
}),
)
Expand Down
4 changes: 2 additions & 2 deletions codegen/model/types/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ type Fields []*Field

// FuncParamsPbTypes returns a list of field lowercase names followed by their pb types.
func (fs Fields) FuncParamsPbTypes() []jen.Code {
return sliceutil.Transform(fs, func(i int, f *Field) jen.Code { return f.FuncParamPbType() })
return sliceutil.Transform(fs, func(_ int, f *Field) jen.Code { return f.FuncParamPbType() })
}

// FuncParamsMirTypes returns a list of field lowercase names followed by their mir types.
func (fs Fields) FuncParamsMirTypes() []jen.Code {
return sliceutil.Transform(fs, func(i int, f *Field) jen.Code { return f.FuncParamMirType() })
return sliceutil.Transform(fs, func(_ int, f *Field) jen.Code { return f.FuncParamMirType() })
}

// FuncParamsIDs returns a list of fields lowercase names as identifiers, without the types.
Expand Down
2 changes: 1 addition & 1 deletion pkg/batchfetcher/batchfetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func NewModule(mc ModuleConfig, epochNr tt.EpochNr, clientProgress *clientprogre

// The DeliverCert handler requests the transactions referenced by the received availability certificate
// from the availability layer.
isspbdsl.UponDeliverCert(m, func(sn tt.SeqNr, cert *apbtypes.Cert, empty bool) error {
isspbdsl.UponDeliverCert(m, func(_ tt.SeqNr, cert *apbtypes.Cert, empty bool) error {
// Create an empty output item and enqueue it immediately.
// Actual output will be delayed until the transactions have been received.
// This is necessary to preserve the order of incoming and outgoing events.
Expand Down
2 changes: 1 addition & 1 deletion pkg/debugger/debugger.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func NewWebSocketDebugger(
logger logging.Logger,
) (*eventlog.Recorder, error) {
// writerFactory creates and returns a WebSocket-based event writer
writerFactory := func(_ string, ownID t.NodeID, l logging.Logger) (eventlog.EventWriter, error) {
writerFactory := func(_ string, _ t.NodeID, l logging.Logger) (eventlog.EventWriter, error) {
return newWSWriter(fmt.Sprintf(":%s", port), l), nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/deploytest/localtransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type LocalTransportLayer interface {
func NewLocalTransportLayer(sim *Simulation, transportType string, nodeIDsWeight map[t.NodeID]types.VoteWeight, logger logging.Logger) (LocalTransportLayer, error) {
switch transportType {
case "sim":
messageDelayFn := func(from, to t.NodeID) time.Duration {
messageDelayFn := func(_, _ t.NodeID) time.Duration {
// TODO: Make min and max message delay configurable
return testsim.RandDuration(sim.Rand, 0, 10*time.Millisecond)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func IncludeBatchCreation( // nolint:gocognit
batchSize := 0
txCount := 0

txIDs, txs, _ := state.Iterator.NextWhile(func(txID tt.TxID, tx *trantorpbtypes.Transaction) bool {
txIDs, txs, _ := state.Iterator.NextWhile(func(_ tt.TxID, tx *trantorpbtypes.Transaction) bool {
if txCount < params.MaxTransactionsInBatch && batchSize+len(tx.Data) <= params.MaxPayloadInBatch {
txCount++
state.NumUnproposed--
Expand Down Expand Up @@ -182,7 +182,7 @@ func IncludeBatchCreation( // nolint:gocognit
// ClientProgress - for each client, list of pending transactions sorted by TxNo - that
// would make pruning significantly more efficient.
state.ClientProgress.LoadPb(clientProgress.Pb())
_, removedTXs := state.Transactions.RemoveSelected(func(txID tt.TxID, tx *trantorpbtypes.Transaction) bool {
_, removedTXs := state.Transactions.RemoveSelected(func(_ tt.TxID, tx *trantorpbtypes.Transaction) bool {
return state.ClientProgress.Contains(tx.ClientId, tx.TxNo)
})
for _, tx := range removedTXs {
Expand Down
2 changes: 1 addition & 1 deletion pkg/net/libp2p/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ func TestMessagingWithNewNodes(t *testing.T) {
}
}

receiver := func(nodeID types.NodeID, events chan *events.EventList, stop chan struct{}) {
receiver := func(_ types.NodeID, events chan *events.EventList, stop chan struct{}) {
defer receivers.Done()

for {
Expand Down
2 changes: 1 addition & 1 deletion pkg/orderers/internal/parts/catchup/catchup.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func SendDoneMessages(

// Collect the preprepare digests of all committed certificates.
digests := make([][]byte, 0, state.Segment.Len())
maputil.IterateSorted(state.Slots[state.View], func(sn tt.SeqNr, slot *common.PbftSlot) bool {
maputil.IterateSorted(state.Slots[state.View], func(_ tt.SeqNr, slot *common.PbftSlot) bool {
digests = append(digests, slot.Digest)
return true
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/trantor/testing/smr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ func newDeployment(conf *TestConfig) (*deploytest.Deployment, error) {
var simulation *deploytest.Simulation
if conf.Transport == "sim" {
r := rand.New(rand.NewSource(conf.RandomSeed)) // nolint: gosec
eventDelayFn := func(e *eventpb.Event) time.Duration {
eventDelayFn := func(_ *eventpb.Event) time.Duration {
// TODO: Make min and max event processing delay configurable
return testsim.RandDuration(r, 0, time.Microsecond)
}
Expand Down

0 comments on commit ca84cbe

Please sign in to comment.