Skip to content

Commit 80815c9

Browse files
committed
lntest+itest: adjust tests to work with the RBF coop close changes
1 parent 093fb0d commit 80815c9

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

itest/lnd_coop_close_rbf_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func testCoopCloseRbf(ht *lntest.HarnessTest) {
4242
alicePendingUpdate := aliceCloseUpdate.GetClosePending()
4343
require.NotNil(ht, aliceCloseUpdate)
4444
require.Equal(
45-
ht, int64(aliceFeeRate), alicePendingUpdate.FeePerVbyte,
45+
ht, int64(aliceFeeRate), int64(alicePendingUpdate.FeePerKw/250),
4646
)
4747
require.True(ht, alicePendingUpdate.LocalCloseTx)
4848

@@ -57,7 +57,9 @@ func testCoopCloseRbf(ht *lntest.HarnessTest) {
5757
// Confirm that this new update was at 10 sat/vb.
5858
bobPendingUpdate := bobCloseUpdate.GetClosePending()
5959
require.NotNil(ht, bobCloseUpdate)
60-
require.Equal(ht, bobPendingUpdate.FeePerVbyte, int64(bobFeeRate))
60+
require.Equal(
61+
ht, int64(bobPendingUpdate.FeePerKw/250), int64(bobFeeRate),
62+
)
6163
require.True(ht, bobPendingUpdate.LocalCloseTx)
6264

6365
var err error
@@ -68,7 +70,9 @@ func testCoopCloseRbf(ht *lntest.HarnessTest) {
6870
require.NoError(ht, err)
6971
alicePendingUpdate = aliceCloseUpdate.GetClosePending()
7072
require.NotNil(ht, aliceCloseUpdate)
71-
require.Equal(ht, alicePendingUpdate.FeePerVbyte, int64(bobFeeRate))
73+
require.Equal(
74+
ht, int64(alicePendingUpdate.FeePerKw/250), int64(bobFeeRate),
75+
)
7276
require.False(ht, alicePendingUpdate.LocalCloseTx)
7377

7478
// We'll now attempt to make a fee update that increases Alice's fee
@@ -84,7 +88,7 @@ func testCoopCloseRbf(ht *lntest.HarnessTest) {
8488
alicePendingUpdate = aliceCloseUpdate.GetClosePending()
8589
require.NotNil(ht, aliceCloseUpdate)
8690
require.Equal(
87-
ht, alicePendingUpdate.FeePerVbyte,
91+
ht, int64(alicePendingUpdate.FeePerKw/250),
8892
int64(aliceRejectedFeeRate),
8993
)
9094
require.True(ht, alicePendingUpdate.LocalCloseTx)
@@ -118,7 +122,7 @@ func testCoopCloseRbf(ht *lntest.HarnessTest) {
118122
alicePendingUpdate = aliceCloseUpdate.GetClosePending()
119123
require.NotNil(ht, aliceCloseUpdate)
120124
require.Equal(
121-
ht, alicePendingUpdate.FeePerVbyte, int64(aliceFeeRate),
125+
ht, int64(alicePendingUpdate.FeePerKw/250), int64(aliceFeeRate),
122126
)
123127
require.True(ht, alicePendingUpdate.LocalCloseTx)
124128

lntest/harness.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,9 +1343,14 @@ func (h *HarnessTest) CloseChannelAssertPending(hn *node.HarnessNode,
13431343
continue
13441344
}
13451345

1346-
notifyRate := pendingClose.ClosePending.FeePerVbyte
1346+
// Close pending nottification in FeePerKw overwrites
1347+
// FeePerVbyte.
1348+
notifyRate := uint64(pendingClose.ClosePending.FeePerVbyte)
1349+
if pendingClose.ClosePending.FeePerKw != 0 {
1350+
notifyRate = pendingClose.ClosePending.FeePerKw / 250
1351+
}
13471352
if closeOpts.localTxOnly &&
1348-
notifyRate != int64(closeReq.SatPerVbyte) {
1353+
notifyRate != closeReq.SatPerVbyte {
13491354

13501355
continue
13511356
}

0 commit comments

Comments
 (0)