From ced8fb5dfbc87e9511c658123e49c0620f9259a7 Mon Sep 17 00:00:00 2001 From: Sophia Koehler Date: Thu, 19 Dec 2024 13:51:28 +0100 Subject: [PATCH] chore(all): remove unnecessary flags Signed-off-by: Sophia Koehler --- apps/payment/app_internal_test.go | 4 ++-- channel/persistence/statemachine_test.go | 4 ++-- client/restore_internal_test.go | 2 +- watcher/local/watcher_test.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/payment/app_internal_test.go b/apps/payment/app_internal_test.go index 710ddc08..01eb8f47 100644 --- a/apps/payment/app_internal_test.go +++ b/apps/payment/app_internal_test.go @@ -95,7 +95,7 @@ func TestApp_ValidTransition(t *testing.T) { numParticipants := len(tt.from[0]) for i := 0; i < numParticipants; i++ { // valid self-transition - assert.NoError(app.ValidTransition(nil, from, from, channel.Index(i))) //nolint:gosec + assert.NoError(app.ValidTransition(nil, from, from, channel.Index(i))) } for _, tto := range tt.tos { @@ -105,7 +105,7 @@ func TestApp_ValidTransition(t *testing.T) { test.WithBalances(asBalances(tto.alloc...)...), ) for i := 0; i < numParticipants; i++ { - err := app.ValidTransition(nil, from, to, channel.Index(i)) //nolint:gosec + err := app.ValidTransition(nil, from, to, channel.Index(i)) if i == tto.valid { assert.NoError(err) } else { diff --git a/channel/persistence/statemachine_test.go b/channel/persistence/statemachine_test.go index c2dae4f6..daf9d3d4 100644 --- a/channel/persistence/statemachine_test.go +++ b/channel/persistence/statemachine_test.go @@ -76,7 +76,7 @@ func TestStateMachine(t *testing.T) { sig, err = channel.Sign(acc, csm.StagingState(), b) require.NoError(err) } - err = sm.AddSig(ctx, channel.Index(i), sig) //nolint:gosec + err = sm.AddSig(ctx, channel.Index(i), sig) require.NoError(err) tpr.AssertEqual(csm) } @@ -152,7 +152,7 @@ func TestStateMachine(t *testing.T) { // Set Progressed timeout := ctest.NewRandomTimeout(rng) - idx := channel.Index(rng.Intn(s.NumParts())) //nolint:gosec + idx := channel.Index(rng.Intn(s.NumParts())) e := channel.NewProgressedEvent(s.ID[0], timeout, s, idx) err = sm.SetProgressed(ctx, e) require.NoError(err) diff --git a/client/restore_internal_test.go b/client/restore_internal_test.go index 5bfb7d2b..e9baf8fe 100644 --- a/client/restore_internal_test.go +++ b/client/restore_internal_test.go @@ -120,7 +120,7 @@ func mkRndChan(rng *rand.Rand, bID wallet.BackendID) *persistence.Channel { parts[i] = map[wallet.BackendID]wallet.Address{bID: wallettest.NewRandomAccount(rng, bID).Address()} } ch := persistence.NewChannel() - ch.IdxV = channel.Index(rng.Intn(channel.MaxNumParts)) //nolint:gosec + ch.IdxV = channel.Index(rng.Intn(channel.MaxNumParts)) ch.ParamsV = test.NewRandomParams(rng, test.WithParts(parts)) sigs := make([]bool, channel.MaxNumParts) opts := test.WithParams(ch.ParamsV) diff --git a/watcher/local/watcher_test.go b/watcher/local/watcher_test.go index bd6d8e89..244ad553 100644 --- a/watcher/local/watcher_test.go +++ b/watcher/local/watcher_test.go @@ -735,7 +735,7 @@ func randomTxsForSingleCh(rng *rand.Rand, n int) (*channel.Params, []channel.Tra txs := make([]channel.Transaction, n) for i := range txs { txs[i] = channel.Transaction{State: initialState.Clone()} - txs[i].State.Version = uint64(i) //nolint:gosec + txs[i].State.Version = uint64(i) } return params, txs }