Skip to content

Commit 6fb102c

Browse files
committed
test: Changed small_txpuzzle_randfee to return the virtual size instead of the transaction hex for feerate calculation.
1 parent 6863ad7 commit 6fb102c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/functional/feature_fee_estimation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def small_txpuzzle_randfee(
6262
unconflist.append({"txid": txid, "vout": 0, "value": total_in - amount - fee})
6363
unconflist.append({"txid": txid, "vout": 1, "value": amount})
6464

65-
return (tx.serialize().hex(), fee)
65+
return (tx.get_vsize(), fee)
6666

6767

6868
def check_raw_estimates(node, fees_seen):
@@ -158,7 +158,7 @@ def transact_and_mine(self, numblocks, mining_node):
158158
random.shuffle(self.confutxo)
159159
for _ in range(random.randrange(100 - 50, 100 + 50)):
160160
from_index = random.randint(1, 2)
161-
(txhex, fee) = small_txpuzzle_randfee(
161+
(tx_bytes, fee) = small_txpuzzle_randfee(
162162
self.wallet,
163163
self.nodes[from_index],
164164
self.confutxo,
@@ -167,7 +167,7 @@ def transact_and_mine(self, numblocks, mining_node):
167167
min_fee,
168168
min_fee,
169169
)
170-
tx_kbytes = (len(txhex) // 2) / 1000.0
170+
tx_kbytes = tx_bytes / 1000.0
171171
self.fees_per_kb.append(float(fee) / tx_kbytes)
172172
self.sync_mempools(wait=0.1)
173173
mined = mining_node.getblock(self.generate(mining_node, 1)[0], True)["tx"]

0 commit comments

Comments
 (0)