0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-03 09:56:38 -05:00

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
This commit is contained in:
MarcoFalke 2023-01-03 13:19:19 +01:00
parent 8339f3cea8
commit fa2d82103f
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -321,6 +321,7 @@ class MiniWallet:
confirmations=0, confirmations=0,
) for i in range(len(tx.vout))], ) for i in range(len(tx.vout))],
"txid": txid, "txid": txid,
"wtxid": tx.getwtxid(),
"hex": tx.serialize().hex(), "hex": tx.serialize().hex(),
"tx": tx, "tx": tx,
} }
@ -344,8 +345,9 @@ class MiniWallet:
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) 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)
if not target_weight: if not target_weight:
assert_equal(tx["tx"].get_vsize(), vsize) assert_equal(tx["tx"].get_vsize(), vsize)
tx["new_utxo"] = tx.pop("new_utxos")[0]
return {"txid": tx["txid"], "wtxid": tx["tx"].getwtxid(), "hex": tx["hex"], "tx": tx["tx"], "new_utxo": tx["new_utxos"][0]} return tx
def sendrawtransaction(self, *, from_node, tx_hex, maxfeerate=0, **kwargs): def sendrawtransaction(self, *, from_node, tx_hex, maxfeerate=0, **kwargs):
txid = from_node.sendrawtransaction(hexstring=tx_hex, maxfeerate=maxfeerate, **kwargs) txid = from_node.sendrawtransaction(hexstring=tx_hex, maxfeerate=maxfeerate, **kwargs)