From 7af699f3a7d5600bf7f2745b87f1962772b2f126 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 3 May 2018 18:36:55 -0700 Subject: [PATCH] contractcourt: update chain watcher tests to latest API --- contractcourt/chain_watcher_test.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/contractcourt/chain_watcher_test.go b/contractcourt/chain_watcher_test.go index 7e65c5fa..d5d4a487 100644 --- a/contractcourt/chain_watcher_test.go +++ b/contractcourt/chain_watcher_test.go @@ -62,10 +62,11 @@ func TestChainWatcherRemoteUnilateralClose(t *testing.T) { aliceNotifier := &mockNotifier{ spendChan: make(chan *chainntnfs.SpendDetail), } - aliceChainWatcher, err := newChainWatcher( - aliceChannel.State(), aliceNotifier, nil, aliceChannel.Signer, - nil, nil, - ) + aliceChainWatcher, err := newChainWatcher(chainWatcherConfig{ + chanState: aliceChannel.State(), + notifier: aliceNotifier, + signer: aliceChannel.Signer, + }) if err != nil { t.Fatalf("unable to create chain watcher: %v", err) } @@ -77,7 +78,7 @@ func TestChainWatcherRemoteUnilateralClose(t *testing.T) { // We'll request a new channel event subscription from Alice's chain // watcher. - chanEvents := aliceChainWatcher.SubscribeChannelEvents(false) + chanEvents := aliceChainWatcher.SubscribeChannelEvents() // If we simulate an immediate broadcast of the current commitment by // Bob, then the chain watcher should detect this case. @@ -125,10 +126,11 @@ func TestChainWatcherRemoteUnilateralClosePendingCommit(t *testing.T) { aliceNotifier := &mockNotifier{ spendChan: make(chan *chainntnfs.SpendDetail), } - aliceChainWatcher, err := newChainWatcher( - aliceChannel.State(), aliceNotifier, nil, aliceChannel.Signer, - nil, nil, - ) + aliceChainWatcher, err := newChainWatcher(chainWatcherConfig{ + chanState: aliceChannel.State(), + notifier: aliceNotifier, + signer: aliceChannel.Signer, + }) if err != nil { t.Fatalf("unable to create chain watcher: %v", err) } @@ -139,7 +141,7 @@ func TestChainWatcherRemoteUnilateralClosePendingCommit(t *testing.T) { // We'll request a new channel event subscription from Alice's chain // watcher. - chanEvents := aliceChainWatcher.SubscribeChannelEvents(false) + chanEvents := aliceChainWatcher.SubscribeChannelEvents() // Next, we'll create a fake HTLC just so we can advance Alice's // channel state to a new pending commitment on her remote commit chain