Skip to content

Commit

Permalink
lnwallet/test: stop creating burning tx in tests
Browse files Browse the repository at this point in the history
bitcoind v25.0 updated the `sendrawtransaction` RPC to have an optional
argument `maxburnamount` with a default value of 0. This means our
existing test that uses burning output cannot be published, hence, we
remove the usage of it in our tests and replace it with a normal tx.
  • Loading branch information
yyforyongyu committed Jan 25, 2024
1 parent 11bafe8 commit 783e914
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lnwallet/test/test_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -1472,15 +1472,20 @@ func testTransactionSubscriptions(miner *rpctest.Harness,
// We'll also ensure that the client is able to send our new
// notifications when we _create_ transactions ourselves that spend our
// own outputs.
b := txscript.NewScriptBuilder()
b.AddOp(txscript.OP_RETURN)
outputScript, err := b.Script()
require.NoError(t, err, "unable to make output script")
addr, err := alice.NewAddress(
lnwallet.WitnessPubKey, false,
lnwallet.DefaultAccountName,
)
require.NoError(t, err)

outputScript, err := txscript.PayToAddrScript(addr)
require.NoError(t, err)

burnOutput := wire.NewTxOut(outputAmt, outputScript)
tx, err := alice.SendOutputs(
[]*wire.TxOut{burnOutput}, 2500, 1, labels.External,
)
require.NoError(t, err, "unable to create burn tx")
require.NoError(t, err, "unable to create tx")
txid := tx.TxHash()
err = waitForMempoolTx(miner, &txid)
require.NoError(t, err, "tx not relayed to miner")
Expand Down

0 comments on commit 783e914

Please sign in to comment.