lnwallet: turn off RBF detection in test

This commit is contained in:
Oliver Gugger
2024-09-03 13:10:54 +02:00
parent 91ade89a78
commit c156d17da5

View File

@@ -1758,7 +1758,10 @@ func testPublishTransaction(r *rpctest.Harness,
tx3, tx3Spend *wire.MsgTx tx3, tx3Spend *wire.MsgTx
) )
t.Run("rbf_tests", func(t *testing.T) { t.Run("rbf_tests", func(t *testing.T) {
for _, rbf := range []bool{false, true} { // Starting with bitcoind v28.0 and later, mempool full RBF is
// turned on, so there's no way to _not_ signal RBF anymore.
const rbf = true
// Now we'll try to double spend an output with a // Now we'll try to double spend an output with a
// different transaction. Create a new tx and publish // different transaction. Create a new tx and publish
// it. This is the output we'll try to double spend. // it. This is the output we'll try to double spend.
@@ -1807,15 +1810,9 @@ func testPublishTransaction(r *rpctest.Harness,
err = alice.PublishTransaction(tx5, labels.External) err = alice.PublishTransaction(tx5, labels.External)
// If RBF is not enabled, we expect this to be rejected // We expect it to be rejected/ because it doesn't pay enough
// because it is a double spend. // fees.
expectedErr := lnwallet.ErrDoubleSpend expectedErr := chain.ErrInsufficientFee
// If RBF is enabled, we expect it to be rejected
// because it doesn't pay enough fees.
if rbf {
expectedErr = chain.ErrInsufficientFee
}
// Assert the expected error. // Assert the expected error.
require.ErrorIsf(t, err, expectedErr, "has rbf=%v", rbf) require.ErrorIsf(t, err, expectedErr, "has rbf=%v", rbf)
@@ -1836,19 +1833,13 @@ func testPublishTransaction(r *rpctest.Harness,
require.NoError(t, err) require.NoError(t, err)
// Expect rejection in non-RBF case. // Expect rejection in non-RBF case.
expErr := lnwallet.ErrDoubleSpend
if rbf {
// Expect success in rbf case.
expErr = nil
tx3Spend = tx6 tx3Spend = tx6
}
err = alice.PublishTransaction(tx6, labels.External) err = alice.PublishTransaction(tx6, labels.External)
require.ErrorIs(t, err, expErr) require.NoError(t, err)
// Mine the tx spending tx3. // Mine the tx spending tx3.
err = mineAndAssert(r, tx3Spend) err = mineAndAssert(r, tx3Spend)
require.NoError(t, err) require.NoError(t, err)
}
}) })
t.Run("tx_double_spend", func(t *testing.T) { t.Run("tx_double_spend", func(t *testing.T) {
@@ -3071,9 +3062,9 @@ func testSingleFunderExternalFundingTx(miner *rpctest.Harness,
) )
} }
// TestInterfaces tests all registered interfaces with a unified set of tests // TestLightningWallet tests all registered interfaces with a unified set of
// which exercise each of the required methods found within the WalletController // tests which exercise each of the required methods found within the
// interface. // WalletController interface.
// //
// NOTE: In the future, when additional implementations of the WalletController // NOTE: In the future, when additional implementations of the WalletController
// interface have been implemented, in order to ensure the new concrete // interface have been implemented, in order to ensure the new concrete