Skip to content

Commit 9ea9e97

Browse files
authored
Fix tests that sometimes get p2tr inputs (#3049)
`SingleKeyOnChainWallet` will sometimes use p2tr inputs when `fundTransaction` is called. This creates a slightly higher feerate that makes some tests fail. I ran the test suite with p2tr always used to see what tests fail and bumped the max feerate so both p2tr and p2wpkh pass.
1 parent 24e397a commit 9ea9e97

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

eclair-core/src/test/scala/fr/acinq/eclair/channel/states/c/WaitForDualFundingConfirmedStateSpec.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,15 +416,15 @@ class WaitForDualFundingConfirmedStateSpec extends TestKitBaseClass with Fixture
416416
val balanceBob2 = bob.stateData.asInstanceOf[DATA_WAIT_FOR_DUAL_FUNDING_CONFIRMED].commitments.latest.localCommit.spec.toLocal
417417
assert(balanceBob2 == TestConstants.nonInitiatorFundingSatoshis.toMilliSatoshi)
418418
val fundingTx2 = alice.stateData.asInstanceOf[DATA_WAIT_FOR_DUAL_FUNDING_CONFIRMED].commitments.latest.localFundingStatus.asInstanceOf[DualFundedUnconfirmedFundingTx].sharedTx.asInstanceOf[FullySignedSharedTransaction]
419-
assert(FeeratePerKw(12_500 sat) <= fundingTx2.feerate && fundingTx2.feerate < FeeratePerKw(13_000 sat))
419+
assert(FeeratePerKw(12_500 sat) <= fundingTx2.feerate && fundingTx2.feerate < FeeratePerKw(13_500 sat))
420420

421421
// Alice RBFs the funding transaction again: Bob keeps contributing the same amount.
422422
val feerate3 = FeeratePerKw(15_000 sat)
423423
testBumpFundingFees(f, Some(feerate3))
424424
val balanceBob3 = bob.stateData.asInstanceOf[DATA_WAIT_FOR_DUAL_FUNDING_CONFIRMED].commitments.latest.localCommit.spec.toLocal
425425
assert(balanceBob3 == TestConstants.nonInitiatorFundingSatoshis.toMilliSatoshi)
426426
val fundingTx3 = alice.stateData.asInstanceOf[DATA_WAIT_FOR_DUAL_FUNDING_CONFIRMED].commitments.latest.localFundingStatus.asInstanceOf[DualFundedUnconfirmedFundingTx].sharedTx.asInstanceOf[FullySignedSharedTransaction]
427-
assert(FeeratePerKw(15_000 sat) <= fundingTx3.feerate && fundingTx3.feerate < FeeratePerKw(15_500 sat))
427+
assert(FeeratePerKw(15_000 sat) <= fundingTx3.feerate && fundingTx3.feerate < FeeratePerKw(15_700 sat))
428428
assert(alice.stateData.asInstanceOf[DATA_WAIT_FOR_DUAL_FUNDING_CONFIRMED].previousFundingTxs.length == 2)
429429

430430
// The initial funding transaction confirms
@@ -452,7 +452,7 @@ class WaitForDualFundingConfirmedStateSpec extends TestKitBaseClass with Fixture
452452
assert(liquidityFee1.total < liquidityFee2.total)
453453
assert(balanceBob2 == (remoteFunding1 + liquidityFee2.total).toMilliSatoshi)
454454
val fundingTx2 = alice.stateData.asInstanceOf[DATA_WAIT_FOR_DUAL_FUNDING_CONFIRMED].commitments.latest.localFundingStatus.asInstanceOf[DualFundedUnconfirmedFundingTx].sharedTx.asInstanceOf[FullySignedSharedTransaction]
455-
assert(FeeratePerKw(12_500 sat) <= fundingTx2.feerate && fundingTx2.feerate < FeeratePerKw(13_000 sat))
455+
assert(FeeratePerKw(12_500 sat) <= fundingTx2.feerate && fundingTx2.feerate < FeeratePerKw(13_500 sat))
456456

457457
// Alice RBFs again and purchases more inbound liquidity.
458458
val remoteFunding3 = 750_000.sat
@@ -463,7 +463,7 @@ class WaitForDualFundingConfirmedStateSpec extends TestKitBaseClass with Fixture
463463
val balanceBob3 = bob.stateData.asInstanceOf[DATA_WAIT_FOR_DUAL_FUNDING_CONFIRMED].commitments.latest.localCommit.spec.toLocal
464464
assert(balanceBob3 == (remoteFunding3 + liquidityFee3.total).toMilliSatoshi)
465465
val fundingTx3 = alice.stateData.asInstanceOf[DATA_WAIT_FOR_DUAL_FUNDING_CONFIRMED].commitments.latest.localFundingStatus.asInstanceOf[DualFundedUnconfirmedFundingTx].sharedTx.asInstanceOf[FullySignedSharedTransaction]
466-
assert(FeeratePerKw(15_000 sat) <= fundingTx3.feerate && fundingTx3.feerate < FeeratePerKw(15_500 sat))
466+
assert(FeeratePerKw(15_000 sat) <= fundingTx3.feerate && fundingTx3.feerate < FeeratePerKw(15_700 sat))
467467

468468
// Alice RBFs again and purchases less inbound liquidity.
469469
val remoteFunding4 = 250_000.sat
@@ -474,7 +474,7 @@ class WaitForDualFundingConfirmedStateSpec extends TestKitBaseClass with Fixture
474474
val balanceBob4 = bob.stateData.asInstanceOf[DATA_WAIT_FOR_DUAL_FUNDING_CONFIRMED].commitments.latest.localCommit.spec.toLocal
475475
assert(balanceBob4 == (remoteFunding4 + liquidityFee4.total).toMilliSatoshi)
476476
val fundingTx4 = alice.stateData.asInstanceOf[DATA_WAIT_FOR_DUAL_FUNDING_CONFIRMED].commitments.latest.localFundingStatus.asInstanceOf[DualFundedUnconfirmedFundingTx].sharedTx.asInstanceOf[FullySignedSharedTransaction]
477-
assert(FeeratePerKw(17_500 sat) <= fundingTx4.feerate && fundingTx4.feerate < FeeratePerKw(18_000 sat))
477+
assert(FeeratePerKw(17_500 sat) <= fundingTx4.feerate && fundingTx4.feerate < FeeratePerKw(18_200 sat))
478478

479479
// Alice tries to cancel the liquidity purchase.
480480
val sender = TestProbe()

eclair-core/src/test/scala/fr/acinq/eclair/channel/states/e/NormalSplicesStateSpec.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ class NormalSplicesStateSpec extends TestKitBaseClass with FixtureAnyFunSuiteLik
846846
alice2bob.forward(bob)
847847
exchangeSpliceSigs(alice, bob, alice2bob, bob2alice, sender)
848848
val spliceTx1 = alice.stateData.asInstanceOf[DATA_NORMAL].commitments.latest.localFundingStatus.asInstanceOf[DualFundedUnconfirmedFundingTx].sharedTx.asInstanceOf[FullySignedSharedTransaction]
849-
assert(FeeratePerKw(10_000 sat) <= spliceTx1.feerate && spliceTx1.feerate < FeeratePerKw(10_500 sat))
849+
assert(FeeratePerKw(10_000 sat) <= spliceTx1.feerate && spliceTx1.feerate < FeeratePerKw(10_700 sat))
850850

851851
// Alice RBFs the previous transaction and purchases less liquidity from Bob.
852852
// Our dummy bitcoin wallet adds an additional input at every funding attempt.
@@ -887,7 +887,7 @@ class NormalSplicesStateSpec extends TestKitBaseClass with FixtureAnyFunSuiteLik
887887
exchangeSpliceSigs(alice, bob, alice2bob, bob2alice, sender)
888888
val spliceTx2 = alice.stateData.asInstanceOf[DATA_NORMAL].commitments.latest.localFundingStatus.asInstanceOf[DualFundedUnconfirmedFundingTx].sharedTx.asInstanceOf[FullySignedSharedTransaction]
889889
spliceTx1.signedTx.txIn.map(_.outPoint).foreach(txIn => assert(spliceTx2.signedTx.txIn.map(_.outPoint).contains(txIn)))
890-
assert(FeeratePerKw(12_500 sat) <= spliceTx2.feerate && spliceTx2.feerate < FeeratePerKw(13_000 sat))
890+
assert(FeeratePerKw(12_500 sat) <= spliceTx2.feerate && spliceTx2.feerate < FeeratePerKw(13_500 sat))
891891

892892
// Alice RBFs the previous transaction and purchases more liquidity from Bob.
893893
// Our dummy bitcoin wallet adds an additional input at every funding attempt.
@@ -932,7 +932,7 @@ class NormalSplicesStateSpec extends TestKitBaseClass with FixtureAnyFunSuiteLik
932932
exchangeSpliceSigs(alice, bob, alice2bob, bob2alice, sender)
933933
val spliceTx3 = alice.stateData.asInstanceOf[DATA_NORMAL].commitments.latest.localFundingStatus.asInstanceOf[DualFundedUnconfirmedFundingTx].sharedTx.asInstanceOf[FullySignedSharedTransaction]
934934
spliceTx2.signedTx.txIn.map(_.outPoint).foreach(txIn => assert(spliceTx3.signedTx.txIn.map(_.outPoint).contains(txIn)))
935-
assert(FeeratePerKw(15_000 sat) <= spliceTx3.feerate && spliceTx3.feerate < FeeratePerKw(15_500 sat))
935+
assert(FeeratePerKw(15_000 sat) <= spliceTx3.feerate && spliceTx3.feerate < FeeratePerKw(15_700 sat))
936936

937937
// Alice RBFs the previous transaction and tries to cancel the liquidity purchase.
938938
alice ! CMD_BUMP_FUNDING_FEE(sender.ref, FeeratePerKw(17_500 sat), 50_000 sat, 0, requestFunding_opt = None)

0 commit comments

Comments
 (0)