Changeset View
Changeset View
Standalone View
Standalone View
qa/rpc-tests/abc-rpc.py
Show All 32 Lines | class ABC_RPC_Test (BitcoinTestFramework): | ||||
def run_test (self): | def run_test (self): | ||||
# Check that we start with DEFAULT_MAX_BLOCK_SIZE | # Check that we start with DEFAULT_MAX_BLOCK_SIZE | ||||
getsize = self.nodes[0].getexcessiveblock() | getsize = self.nodes[0].getexcessiveblock() | ||||
ebs = getsize['excessiveBlockSize'] | ebs = getsize['excessiveBlockSize'] | ||||
assert_equal(ebs, DEFAULT_MAX_BLOCK_SIZE) | assert_equal(ebs, DEFAULT_MAX_BLOCK_SIZE) | ||||
# Check that setting to legacy size is ok | # Check that setting to legacy size is ok | ||||
self.nodes[0].setexcessiveblock(LEGACY_MAX_BLOCK_SIZE) | self.nodes[0].setexcessiveblock(LEGACY_MAX_BLOCK_SIZE + 1) | ||||
getsize = self.nodes[0].getexcessiveblock() | getsize = self.nodes[0].getexcessiveblock() | ||||
ebs = getsize['excessiveBlockSize'] | ebs = getsize['excessiveBlockSize'] | ||||
assert_equal(ebs, LEGACY_MAX_BLOCK_SIZE) | assert_equal(ebs, LEGACY_MAX_BLOCK_SIZE + 1) | ||||
# Check that going below legacy size is not accepted | # Check that going below legacy size is not accepted | ||||
try: | try: | ||||
self.nodes[0].setexcessiveblock(LEGACY_MAX_BLOCK_SIZE - 1) | self.nodes[0].setexcessiveblock(LEGACY_MAX_BLOCK_SIZE) | ||||
except JSONRPCException as e: | except JSONRPCException as e: | ||||
assert("Invalid parameter, excessiveblock must be larger than %d" % LEGACY_MAX_BLOCK_SIZE | assert("Invalid parameter, excessiveblock must be larger than %d" % LEGACY_MAX_BLOCK_SIZE | ||||
in e.error['message']) | in e.error['message']) | ||||
else: | else: | ||||
raise AssertionError("Must not accept excessiveblock values < %d bytes" % LEGACY_MAX_BLOCK_SIZE) | raise AssertionError("Must not accept excessiveblock values <= %d bytes" % LEGACY_MAX_BLOCK_SIZE) | ||||
getsize = self.nodes[0].getexcessiveblock() | getsize = self.nodes[0].getexcessiveblock() | ||||
ebs = getsize['excessiveBlockSize'] | ebs = getsize['excessiveBlockSize'] | ||||
assert_equal(ebs, LEGACY_MAX_BLOCK_SIZE) | assert_equal(ebs, LEGACY_MAX_BLOCK_SIZE + 1) | ||||
# Check setting to 2MB | # Check setting to 2MB | ||||
self.nodes[0].setexcessiveblock(2 * ONE_MEGABYTE) | self.nodes[0].setexcessiveblock(2 * ONE_MEGABYTE) | ||||
getsize = self.nodes[0].getexcessiveblock() | getsize = self.nodes[0].getexcessiveblock() | ||||
ebs = getsize['excessiveBlockSize'] | ebs = getsize['excessiveBlockSize'] | ||||
assert_equal(ebs, 2 * ONE_MEGABYTE) | assert_equal(ebs, 2 * ONE_MEGABYTE) | ||||
# Check for EB correctness in the subver string | # Check for EB correctness in the subver string | ||||
self.check_subversion("/Bitcoin ABC:.*\(EB2\.0\)/") | self.check_subversion("/Bitcoin ABC:.*\(EB2\.0\)/") | ||||
Show All 19 Lines |