routing: stop tracking totalAmount in paymentLifecycle
This commit removes the field `totalAmount` from `paymentLifecycle` and only reads it from the channeldb payment.
This commit is contained in:
5 files changed
+33
-21
No files matched your search
+12
-4
@@ -3421,7 +3421,9 @@ func TestSendMPPaymentSucceed(t *testing.T) {
|
||||
// The following mocked methods are called inside resumePayment. Note
|
||||
// that the payment object below will determine the state of the
|
||||
// paymentLifecycle.
|
||||
payment := &channeldb.MPPayment{}
|
||||
payment := &channeldb.MPPayment{
|
||||
Info: &channeldb.PaymentCreationInfo{Value: paymentAmt},
|
||||
}
|
||||
controlTower.On("FetchPayment", identifier).Return(payment, nil)
|
||||
|
||||
// Create a route that can send 1/4 of the total amount. This value
|
||||
@@ -3588,7 +3590,9 @@ func TestSendMPPaymentSucceedOnExtraShards(t *testing.T) {
|
||||
// The following mocked methods are called inside resumePayment. Note
|
||||
// that the payment object below will determine the state of the
|
||||
// paymentLifecycle.
|
||||
payment := &channeldb.MPPayment{}
|
||||
payment := &channeldb.MPPayment{
|
||||
Info: &channeldb.PaymentCreationInfo{Value: paymentAmt},
|
||||
}
|
||||
controlTower.On("FetchPayment", identifier).Return(payment, nil)
|
||||
|
||||
// Create a route that can send 1/4 of the total amount. This value
|
||||
@@ -3800,7 +3804,9 @@ func TestSendMPPaymentFailed(t *testing.T) {
|
||||
// The following mocked methods are called inside resumePayment. Note
|
||||
// that the payment object below will determine the state of the
|
||||
// paymentLifecycle.
|
||||
payment := &channeldb.MPPayment{}
|
||||
payment := &channeldb.MPPayment{
|
||||
Info: &channeldb.PaymentCreationInfo{Value: paymentAmt},
|
||||
}
|
||||
controlTower.On("FetchPayment", identifier).Return(payment, nil)
|
||||
|
||||
// Create a route that can send 1/4 of the total amount. This value
|
||||
@@ -4004,7 +4010,9 @@ func TestSendMPPaymentFailedWithShardsInFlight(t *testing.T) {
|
||||
// The following mocked methods are called inside resumePayment. Note
|
||||
// that the payment object below will determine the state of the
|
||||
// paymentLifecycle.
|
||||
payment := &channeldb.MPPayment{}
|
||||
payment := &channeldb.MPPayment{
|
||||
Info: &channeldb.PaymentCreationInfo{Value: paymentAmt},
|
||||
}
|
||||
controlTower.On("FetchPayment", identifier).Return(payment, nil)
|
||||
|
||||
// Create a route that can send 1/4 of the total amount. This value
|
||||
|
||||
Reference in new issue
Block a user