contractcourt: update chain watcher tests to latest API
This commit is contained in:
parent
a3227ba147
commit
7af699f3a7
@ -62,10 +62,11 @@ func TestChainWatcherRemoteUnilateralClose(t *testing.T) {
|
|||||||
aliceNotifier := &mockNotifier{
|
aliceNotifier := &mockNotifier{
|
||||||
spendChan: make(chan *chainntnfs.SpendDetail),
|
spendChan: make(chan *chainntnfs.SpendDetail),
|
||||||
}
|
}
|
||||||
aliceChainWatcher, err := newChainWatcher(
|
aliceChainWatcher, err := newChainWatcher(chainWatcherConfig{
|
||||||
aliceChannel.State(), aliceNotifier, nil, aliceChannel.Signer,
|
chanState: aliceChannel.State(),
|
||||||
nil, nil,
|
notifier: aliceNotifier,
|
||||||
)
|
signer: aliceChannel.Signer,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unable to create chain watcher: %v", err)
|
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
|
// We'll request a new channel event subscription from Alice's chain
|
||||||
// watcher.
|
// watcher.
|
||||||
chanEvents := aliceChainWatcher.SubscribeChannelEvents(false)
|
chanEvents := aliceChainWatcher.SubscribeChannelEvents()
|
||||||
|
|
||||||
// If we simulate an immediate broadcast of the current commitment by
|
// If we simulate an immediate broadcast of the current commitment by
|
||||||
// Bob, then the chain watcher should detect this case.
|
// Bob, then the chain watcher should detect this case.
|
||||||
@ -125,10 +126,11 @@ func TestChainWatcherRemoteUnilateralClosePendingCommit(t *testing.T) {
|
|||||||
aliceNotifier := &mockNotifier{
|
aliceNotifier := &mockNotifier{
|
||||||
spendChan: make(chan *chainntnfs.SpendDetail),
|
spendChan: make(chan *chainntnfs.SpendDetail),
|
||||||
}
|
}
|
||||||
aliceChainWatcher, err := newChainWatcher(
|
aliceChainWatcher, err := newChainWatcher(chainWatcherConfig{
|
||||||
aliceChannel.State(), aliceNotifier, nil, aliceChannel.Signer,
|
chanState: aliceChannel.State(),
|
||||||
nil, nil,
|
notifier: aliceNotifier,
|
||||||
)
|
signer: aliceChannel.Signer,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unable to create chain watcher: %v", err)
|
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
|
// We'll request a new channel event subscription from Alice's chain
|
||||||
// watcher.
|
// watcher.
|
||||||
chanEvents := aliceChainWatcher.SubscribeChannelEvents(false)
|
chanEvents := aliceChainWatcher.SubscribeChannelEvents()
|
||||||
|
|
||||||
// Next, we'll create a fake HTLC just so we can advance Alice's
|
// 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
|
// channel state to a new pending commitment on her remote commit chain
|
||||||
|
Loading…
Reference in New Issue
Block a user