mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Replace hard-coded constant in test
This commit is contained in:
@@ -18,6 +18,7 @@ from test_framework.messages import (
|
|||||||
CTxInWitness,
|
CTxInWitness,
|
||||||
CTxOut,
|
CTxOut,
|
||||||
MAX_BLOCK_WEIGHT,
|
MAX_BLOCK_WEIGHT,
|
||||||
|
WITNESS_SCALE_FACTOR,
|
||||||
MAX_MONEY,
|
MAX_MONEY,
|
||||||
SEQUENCE_FINAL,
|
SEQUENCE_FINAL,
|
||||||
tx_from_hex,
|
tx_from_hex,
|
||||||
@@ -228,7 +229,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
|
|||||||
|
|
||||||
self.log.info('A really large transaction')
|
self.log.info('A really large transaction')
|
||||||
tx = tx_from_hex(raw_tx_reference)
|
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(
|
self.check_mempool_result(
|
||||||
result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'bad-txns-oversize'}],
|
result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'bad-txns-oversize'}],
|
||||||
rawtxs=[tx.serialize().hex()],
|
rawtxs=[tx.serialize().hex()],
|
||||||
|
|||||||
Reference in New Issue
Block a user