lnwallet: pack htlcView.{OurUpdates|TheirUpdates} into Dual.
This commit moves the collection of updates behind a Dual structure. This allows us in a later commit to index into it via a ChannelParty parameter which will simplify the loops in evaluateHTLCView.
This commit is contained in:
3 files changed
+44
-38
No files matched your search
@@ -8941,9 +8941,11 @@ func TestEvaluateView(t *testing.T) {
|
||||
}
|
||||
|
||||
view := &HtlcView{
|
||||
OurUpdates: test.ourHtlcs,
|
||||
TheirUpdates: test.theirHtlcs,
|
||||
FeePerKw: feePerKw,
|
||||
Updates: lntypes.Dual[[]*paymentDescriptor]{
|
||||
Local: test.ourHtlcs,
|
||||
Remote: test.theirHtlcs,
|
||||
},
|
||||
FeePerKw: feePerKw,
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -8996,11 +8998,12 @@ func TestEvaluateView(t *testing.T) {
|
||||
}
|
||||
|
||||
checkExpectedHtlcs(
|
||||
t, result.OurUpdates, test.ourExpectedHtlcs,
|
||||
t, result.Updates.Local, test.ourExpectedHtlcs,
|
||||
)
|
||||
|
||||
checkExpectedHtlcs(
|
||||
t, result.TheirUpdates, test.theirExpectedHtlcs,
|
||||
t, result.Updates.Remote,
|
||||
test.theirExpectedHtlcs,
|
||||
)
|
||||
|
||||
if lc.channelState.TotalMSatSent != test.expectSent {
|
||||
|
||||
Reference in new issue
Block a user