mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-08 13:49:35 +02:00
test: remove confusing MAX_BLOCK_BASE_SIZE
The constant `MAX_BLOCK_BASE_SIZE` has been removed from the core implementation years ago due to being confusing and superfluous, as it is implied by the block weight limit (see PRs #10618 and #10608). Since there is also no point in still keeping it in the functional test framework, we switch to weight-based accounting on the relevant test code parts and use `MAX_BLOCK_WEIGHT` instead for the block limit checks.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
import time
|
||||
|
||||
from test_framework.messages import COIN, MAX_BLOCK_BASE_SIZE
|
||||
from test_framework.messages import COIN, MAX_BLOCK_WEIGHT
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal, assert_raises_rpc_error, create_confirmed_utxos, create_lots_of_big_transactions, gen_return_txouts
|
||||
|
||||
@@ -61,15 +61,15 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
|
||||
txids[i] = create_lots_of_big_transactions(self.nodes[0], self.txouts, utxos[start_range:end_range], end_range - start_range, (i+1)*base_fee)
|
||||
|
||||
# Make sure that the size of each group of transactions exceeds
|
||||
# MAX_BLOCK_BASE_SIZE -- otherwise the test needs to be revised to create
|
||||
# more transactions.
|
||||
# MAX_BLOCK_WEIGHT // 4 -- otherwise the test needs to be revised to
|
||||
# create more transactions.
|
||||
mempool = self.nodes[0].getrawmempool(True)
|
||||
sizes = [0, 0, 0]
|
||||
for i in range(3):
|
||||
for j in txids[i]:
|
||||
assert j in mempool
|
||||
sizes[i] += mempool[j]['vsize']
|
||||
assert sizes[i] > MAX_BLOCK_BASE_SIZE # Fail => raise utxo_count
|
||||
assert sizes[i] > MAX_BLOCK_WEIGHT // 4 # Fail => raise utxo_count
|
||||
|
||||
# add a fee delta to something in the cheapest bucket and make sure it gets mined
|
||||
# also check that a different entry in the cheapest bucket is NOT mined
|
||||
|
||||
Reference in New Issue
Block a user