lnwallet/test: stop creating burning tx in tests

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.
This commit is contained in:
yyforyongyu 2024-01-16 16:31:18 +08:00
parent 11bafe84ff
commit 783e914027
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868

View File

@ -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")