Skip to content

Commit

Permalink
cleanup more contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Jan 21, 2021
1 parent c27ec4e commit d13319f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion api/test/paych.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import (
)

func TestPaymentChannels(t *testing.T, b APIBuilder, blocktime time.Duration) {
ctx := context.Background()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
n, sn := b(t, TwoFull, OneMiner)

paymentCreator := n[0]
Expand Down
12 changes: 8 additions & 4 deletions cli/paych_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ func TestPaymentChannels(t *testing.T) {
clitest.QuietMiningLogs()

blocktime := 5 * time.Millisecond
ctx := context.Background()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
nodes, addrs := clitest.StartTwoNodesOneMiner(ctx, t, blocktime)
paymentCreator := nodes[0]
paymentReceiver := nodes[1]
Expand Down Expand Up @@ -92,7 +93,8 @@ func TestPaymentChannelStatus(t *testing.T) {
clitest.QuietMiningLogs()

blocktime := 5 * time.Millisecond
ctx := context.Background()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
nodes, addrs := clitest.StartTwoNodesOneMiner(ctx, t, blocktime)
paymentCreator := nodes[0]
creatorAddr := addrs[0]
Expand Down Expand Up @@ -171,7 +173,8 @@ func TestPaymentChannelVouchers(t *testing.T) {
clitest.QuietMiningLogs()

blocktime := 5 * time.Millisecond
ctx := context.Background()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
nodes, addrs := clitest.StartTwoNodesOneMiner(ctx, t, blocktime)
paymentCreator := nodes[0]
paymentReceiver := nodes[1]
Expand Down Expand Up @@ -303,7 +306,8 @@ func TestPaymentChannelVoucherCreateShortfall(t *testing.T) {
clitest.QuietMiningLogs()

blocktime := 5 * time.Millisecond
ctx := context.Background()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
nodes, addrs := clitest.StartTwoNodesOneMiner(ctx, t, blocktime)
paymentCreator := nodes[0]
creatorAddr := addrs[0]
Expand Down

0 comments on commit d13319f

Please sign in to comment.