aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_fee_estimation.py
diff options
context:
space:
mode:
authorAntoine Poinsot <darosior@protonmail.com>2021-09-21 12:31:18 +0200
committerAntoine Poinsot <darosior@protonmail.com>2021-12-09 14:59:46 +0100
commiteae52dd6abb8efb99d62d38670cea89ff1e41286 (patch)
treee2c8e46992e133a435a13db091fe80669341a901 /test/functional/feature_fee_estimation.py
parent1fc03155e53f4f0a7f0a2529e55e802f49260b23 (diff)
downloadbitcoin-eae52dd6abb8efb99d62d38670cea89ff1e41286.tar.xz
qa: pass scriptsig directly to txins constructor in fee estimation test
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Diffstat (limited to 'test/functional/feature_fee_estimation.py')
-rwxr-xr-xtest/functional/feature_fee_estimation.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/test/functional/feature_fee_estimation.py b/test/functional/feature_fee_estimation.py
index fa40a01f15..a55068ce2f 100755
--- a/test/functional/feature_fee_estimation.py
+++ b/test/functional/feature_fee_estimation.py
@@ -63,19 +63,15 @@ def small_txpuzzle_randfee(
while total_in <= (amount + fee) and len(conflist) > 0:
t = conflist.pop(0)
total_in += t["amount"]
- tx.vin.append(CTxIn(COutPoint(int(t["txid"], 16), t["vout"]), b""))
+ tx.vin.append(CTxIn(COutPoint(int(t["txid"], 16), t["vout"]), REDEEM_SCRIPT))
while total_in <= (amount + fee) and len(unconflist) > 0:
t = unconflist.pop(0)
total_in += t["amount"]
- tx.vin.append(CTxIn(COutPoint(int(t["txid"], 16), t["vout"]), b""))
+ tx.vin.append(CTxIn(COutPoint(int(t["txid"], 16), t["vout"]), REDEEM_SCRIPT))
if total_in <= amount + fee:
raise RuntimeError(f"Insufficient funds: need {amount + fee}, have {total_in}")
tx.vout.append(CTxOut(int((total_in - amount - fee) * COIN), P2SH))
tx.vout.append(CTxOut(int(amount * COIN), P2SH))
- # These transactions don't need to be signed, but we still have to insert
- # the ScriptSig that will satisfy the ScriptPubKey.
- for inp in tx.vin:
- inp.scriptSig = REDEEM_SCRIPT
txid = from_node.sendrawtransaction(hexstring=tx.serialize().hex(), maxfeerate=0)
unconflist.append({"txid": txid, "vout": 0, "amount": total_in - amount - fee})
unconflist.append({"txid": txid, "vout": 1, "amount": amount})
@@ -218,7 +214,7 @@ class EstimateFeeTest(BitcoinTestFramework):
change = Decimal("100") - splitted_amount * utxo_count - fee
tx = CTransaction()
tx.vin = [
- CTxIn(COutPoint(int(cb["txid"], 16), cb["vout"]), b"")
+ CTxIn(COutPoint(int(cb["txid"], 16), cb["vout"]))
for cb in node.listunspent()[:2]
]
tx.vout = [CTxOut(int(splitted_amount * COIN), P2SH) for _ in range(utxo_count)]