func test: use utils function

This commit is contained in:
jp1ac4 2023-12-12 19:58:27 +00:00
parent 5a56fdb108
commit 04503225bc
No known key found for this signature in database
GPG Key ID: A7ACD32423568D7B

View File

@ -1,6 +1,6 @@
from fixtures import *
from test_framework.serializations import PSBT, uint256_from_str
from test_framework.utils import wait_for, COIN, RpcError
from test_framework.utils import sign_and_broadcast_psbt, wait_for, COIN, RpcError
def test_spend_change(lianad, bitcoind):
@ -59,14 +59,6 @@ def test_spend_change(lianad, bitcoind):
bitcoind.generate_block(1, wait_for_mempool=spend_txid)
def sign_and_broadcast_psbt(lianad, psbt):
txid = psbt.tx.txid().hex()
psbt = lianad.signer.sign_psbt(psbt)
lianad.rpc.updatespend(psbt.to_base64())
lianad.rpc.broadcastspend(txid)
return txid
def test_coin_marked_spent(lianad, bitcoind):
"""Test a spent coin is marked as such under various conditions."""
# Receive a coin in a single transaction