mirror of
https://github.com/cryptoadvance/specter-desktop.git
synced 2026-08-13 12:33:29 +02:00
13 lines
411 B
Python
13 lines
411 B
Python
|
|
"""
|
||
|
|
Utility functions for common test suite tasks
|
||
|
|
"""
|
||
|
|
|
||
|
|
|
||
|
|
def spend_utxo(device, wallet, utxo):
|
||
|
|
inputs = [{"txid": utxo["txid"], "vout": utxo["vout"]}]
|
||
|
|
outputs = {wallet.getnewaddress(): 0.0001}
|
||
|
|
tx = wallet.rpc.createrawtransaction(inputs, outputs)
|
||
|
|
txF = wallet.rpc.fundrawtransaction(tx)
|
||
|
|
txFS = device.sign_raw_tx(txF["hex"], wallet)
|
||
|
|
txid = wallet.rpc.sendrawtransaction(txFS["hex"])
|