Skip to content

Commit 969e047

Browse files
committed
Replace hard-coded constant in test
1 parent 327a31d commit 969e047

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/functional/mempool_accept.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
CTxInWitness,
1919
CTxOut,
2020
MAX_BLOCK_WEIGHT,
21+
WITNESS_SCALE_FACTOR,
2122
MAX_MONEY,
2223
SEQUENCE_FINAL,
2324
tx_from_hex,
@@ -228,7 +229,7 @@ def run_test(self):
228229

229230
self.log.info('A really large transaction')
230231
tx = tx_from_hex(raw_tx_reference)
231-
tx.vin = [tx.vin[0]] * math.ceil(MAX_BLOCK_WEIGHT // 4 / len(tx.vin[0].serialize()))
232+
tx.vin = [tx.vin[0]] * math.ceil((MAX_BLOCK_WEIGHT // WITNESS_SCALE_FACTOR) / len(tx.vin[0].serialize()))
232233
self.check_mempool_result(
233234
result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'bad-txns-oversize'}],
234235
rawtxs=[tx.serialize().hex()],

0 commit comments

Comments
 (0)