specter-desktop/tests/utils.py
kdmukai d0f7d3c842
Export device types and labels (#1226)
* Tests passing

UI flow not yet tested

* UI fixes, test suite fixes

* blackify cleanup

* blackify reformat in tests

* Update src/cryptoadvance/specter/cli/cli_noded.py

Co-authored-by: Kim Neunert <kneunert@gmail.com>

* Update descriptor.py

* Update src/cryptoadvance/specter/util/descriptor.py

Co-authored-by: Stepan Snigirev <snigirev.stepan@gmail.com>

* Corrected wallet type determination

* Adding Jade and SeedSigner to DeviceTypes

* Removing test suite artifacts

* differentiate p2sh vs p2pkh

Co-authored-by: Kim Neunert <kneunert@gmail.com>
Co-authored-by: Stepan Snigirev <snigirev.stepan@gmail.com>
2021-06-17 11:09:53 -05:00

12 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"])