aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLőrinc <pap.lorinc@gmail.com>2024-06-18 15:38:16 +0200
committerLőrinc <pap.lorinc@gmail.com>2024-06-18 19:43:33 +0200
commit969e047cfbab86e5819a2c9056e8d2dab17513a8 (patch)
treea513f3a00bea50182695e0856c6fd7ad626de443
parent327a31d1a4f0e9c7b22063bc725bbd160092c552 (diff)
Replace hard-coded constant in test
-rwxr-xr-xtest/functional/mempool_accept.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/functional/mempool_accept.py b/test/functional/mempool_accept.py
index 3d205ffa62..e1cee46839 100755
--- a/test/functional/mempool_accept.py
+++ b/test/functional/mempool_accept.py
@@ -18,6 +18,7 @@ from test_framework.messages import (
CTxInWitness,
CTxOut,
MAX_BLOCK_WEIGHT,
+ WITNESS_SCALE_FACTOR,
MAX_MONEY,
SEQUENCE_FINAL,
tx_from_hex,
@@ -228,7 +229,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
self.log.info('A really large transaction')
tx = tx_from_hex(raw_tx_reference)
- tx.vin = [tx.vin[0]] * math.ceil(MAX_BLOCK_WEIGHT // 4 / len(tx.vin[0].serialize()))
+ tx.vin = [tx.vin[0]] * math.ceil((MAX_BLOCK_WEIGHT // WITNESS_SCALE_FACTOR) / len(tx.vin[0].serialize()))
self.check_mempool_result(
result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'bad-txns-oversize'}],
rawtxs=[tx.serialize().hex()],