mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-19 20:15:18 +02:00
htlcswitch+invoices: circuit key based hodl notifications
This commit modifies hodl htlc notification from invoice registry from a single notification per hash to distinct notifications per htlc. This prepares for htlc-specific information (accept height) to be added to the notification.
This commit is contained in:
@@ -18,8 +18,9 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
testResPreimage = lntypes.Preimage{1, 2, 3}
|
||||
testResHash = testResPreimage.Hash()
|
||||
testResPreimage = lntypes.Preimage{1, 2, 3}
|
||||
testResHash = testResPreimage.Hash()
|
||||
testResCircuitKey = channeldb.CircuitKey{}
|
||||
)
|
||||
|
||||
// TestHtlcIncomingResolverFwdPreimageKnown tests resolution of a forwarded htlc
|
||||
@@ -92,8 +93,8 @@ func TestHtlcIncomingResolverExitSettle(t *testing.T) {
|
||||
|
||||
ctx := newIncomingResolverTestContext(t)
|
||||
ctx.registry.notifyEvent = &invoices.HodlEvent{
|
||||
Hash: testResHash,
|
||||
Preimage: &testResPreimage,
|
||||
CircuitKey: testResCircuitKey,
|
||||
Preimage: &testResPreimage,
|
||||
}
|
||||
ctx.resolve()
|
||||
|
||||
@@ -116,7 +117,7 @@ func TestHtlcIncomingResolverExitCancel(t *testing.T) {
|
||||
|
||||
ctx := newIncomingResolverTestContext(t)
|
||||
ctx.registry.notifyEvent = &invoices.HodlEvent{
|
||||
Hash: testResHash,
|
||||
CircuitKey: testResCircuitKey,
|
||||
}
|
||||
ctx.resolve()
|
||||
ctx.waitForResult(false)
|
||||
@@ -133,8 +134,8 @@ func TestHtlcIncomingResolverExitSettleHodl(t *testing.T) {
|
||||
|
||||
notifyData := <-ctx.registry.notifyChan
|
||||
notifyData.hodlChan <- invoices.HodlEvent{
|
||||
Hash: testResHash,
|
||||
Preimage: &testResPreimage,
|
||||
CircuitKey: testResCircuitKey,
|
||||
Preimage: &testResPreimage,
|
||||
}
|
||||
|
||||
ctx.waitForResult(true)
|
||||
@@ -162,7 +163,7 @@ func TestHtlcIncomingResolverExitCancelHodl(t *testing.T) {
|
||||
ctx.resolve()
|
||||
notifyData := <-ctx.registry.notifyChan
|
||||
notifyData.hodlChan <- invoices.HodlEvent{
|
||||
Hash: testResHash,
|
||||
CircuitKey: testResCircuitKey,
|
||||
}
|
||||
ctx.waitForResult(false)
|
||||
}
|
||||
|
Reference in New Issue
Block a user