mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-30 02:21:08 +02:00
routing+channeldb: make MPPayment into an interface
This commit turns `MPPayment` into an interface inside `routing`. Having this interface gives us the benefit to write more granular unit tests inside payment lifecycle. As seen from the modified unit tests, several hacky ways of testing the `SendPayment` method is now replaced by a mock over `MPPayment`.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
c412ab5ccb
commit
34d0e5d4c5
@ -791,12 +791,6 @@ func testPaymentLifecycle(t *testing.T, test paymentLifecycleTestCase,
|
||||
}
|
||||
}
|
||||
|
||||
func makeActiveAttempt(total, fee int) channeldb.HTLCAttempt {
|
||||
return channeldb.HTLCAttempt{
|
||||
HTLCAttemptInfo: makeAttemptInfo(total, total-fee),
|
||||
}
|
||||
}
|
||||
|
||||
func makeSettledAttempt(total, fee int,
|
||||
preimage lntypes.Preimage) channeldb.HTLCAttempt {
|
||||
|
||||
|
Reference in New Issue
Block a user