multi: add htlcNotifier interface to switch and link
In this commit, a htlcNotifier interface is added to allow for easy unit testing. Instances of the HtlcNotifier are added to the server, switch and link.
This commit is contained in:
9 files changed
+77
No files matched your search
@@ -1750,6 +1750,7 @@ func newSingleLinkTestHarness(chanAmt, chanReserve btcutil.Amount) (
|
||||
MaxFeeAllocation: DefaultMaxLinkFeeAllocation,
|
||||
NotifyActiveChannel: func(wire.OutPoint) {},
|
||||
NotifyInactiveChannel: func(wire.OutPoint) {},
|
||||
HtlcNotifier: aliceSwitch.cfg.HtlcNotifier,
|
||||
}
|
||||
|
||||
aliceLink := NewChannelLink(aliceCfg, aliceLc.channel)
|
||||
@@ -4313,6 +4314,7 @@ func (h *persistentLinkHarness) restartLink(
|
||||
MaxFeeAllocation: DefaultMaxLinkFeeAllocation,
|
||||
NotifyActiveChannel: func(wire.OutPoint) {},
|
||||
NotifyInactiveChannel: func(wire.OutPoint) {},
|
||||
HtlcNotifier: aliceSwitch.cfg.HtlcNotifier,
|
||||
}
|
||||
|
||||
aliceLink := NewChannelLink(aliceCfg, aliceChannel)
|
||||
@@ -5523,6 +5525,7 @@ func TestCheckHtlcForward(t *testing.T) {
|
||||
},
|
||||
FetchLastChannelUpdate: fetchLastChannelUpdate,
|
||||
MaxOutgoingCltvExpiry: DefaultMaxOutgoingCltvExpiry,
|
||||
HtlcNotifier: &mockHTLCNotifier{},
|
||||
},
|
||||
log: log,
|
||||
channel: testChannel.channel,
|
||||
|
||||
Reference in new issue
Block a user