Skip to content

Commit fa2d821

Browse files
author
MarcoFalke
committed
test: Return wtxid from create_self_transfer_multi
This is not used right now, but may be in the future. Also, it simplifies the create_self_transfer return logic
1 parent 8339f3c commit fa2d821

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/functional/test_framework/wallet.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ def create_self_transfer_multi(
321321
confirmations=0,
322322
) for i in range(len(tx.vout))],
323323
"txid": txid,
324+
"wtxid": tx.getwtxid(),
324325
"hex": tx.serialize().hex(),
325326
"tx": tx,
326327
}
@@ -344,8 +345,9 @@ def create_self_transfer(self, *, fee_rate=Decimal("0.003"), fee=Decimal("0"), u
344345
tx = self.create_self_transfer_multi(utxos_to_spend=[utxo_to_spend], locktime=locktime, sequence=sequence, amount_per_output=int(COIN * send_value), target_weight=target_weight)
345346
if not target_weight:
346347
assert_equal(tx["tx"].get_vsize(), vsize)
348+
tx["new_utxo"] = tx.pop("new_utxos")[0]
347349

348-
return {"txid": tx["txid"], "wtxid": tx["tx"].getwtxid(), "hex": tx["hex"], "tx": tx["tx"], "new_utxo": tx["new_utxos"][0]}
350+
return tx
349351

350352
def sendrawtransaction(self, *, from_node, tx_hex, maxfeerate=0, **kwargs):
351353
txid = from_node.sendrawtransaction(hexstring=tx_hex, maxfeerate=maxfeerate, **kwargs)

0 commit comments

Comments
 (0)