routing+channeldb: use HTLCAttempt instead of HTLCAttemptInfo

This commit refactors the params used in lifecycle to prefer
`HTLCAttempt` over `HTLCAttemptInfo`. This change is needed as
`HTLCAttempt` also wraps settled and failure info, which is useful in
the following commits.
This commit is contained in:
yyforyongyu
2023-03-06 17:04:44 +08:00
committed by Olaoluwa Osuntokun
parent a6be939bfa
commit 20e7e801c0
5 changed files with 30 additions and 27 deletions

View File

@@ -38,7 +38,7 @@ func genInfo() (*PaymentCreationInfo, *HTLCAttemptInfo,
}
rhash := sha256.Sum256(preimage[:])
attempt := NewHtlcAttemptInfo(
attempt := NewHtlcAttempt(
0, priv, *testRoute.Copy(), time.Time{}, nil,
)
return &PaymentCreationInfo{
@@ -46,7 +46,7 @@ func genInfo() (*PaymentCreationInfo, *HTLCAttemptInfo,
Value: testRoute.ReceiverAmt(),
CreationTime: time.Unix(time.Now().Unix(), 0),
PaymentRequest: []byte("hola"),
}, attempt, preimage, nil
}, &attempt.HTLCAttemptInfo, preimage, nil
}
// TestPaymentControlSwitchFail checks that payment status returns to Failed