# Copyright (c) 2017 The Bitcoin developers # Copyright (c) 2019 Bitcoin Association # Distributed under the Open BSV software license, see the accompanying file LICENSE. """ Imports some application default values from source files outside the test framework, and defines equivalents of consensus parameters for the test framework. """ import os import re from test_framework.util import get_srcdir # Slurp in policy.h contents _policy_h_fh = open(os.path.join(get_srcdir(), 'src', 'policy', 'policy.h'), 'rt') _policy_h_contents = _policy_h_fh.read() _policy_h_fh.close() # This constant is currently needed to evaluate some that are formulas ONE_MEGABYTE = 1000000 ONE_GIGABYTE = 1000000000 def _extractPolicyValue(name): return eval(re.search(name + ' = (.+);', _policy_h_contents).group(1)) # Extract relevant default values parameters # The maximum allowed block size before the fork
# Copyright (c) 2017 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Imports some application default values from source files outside the test framework, and defines equivalents of consensus parameters for the test framework. """ import os import re from test_framework.util import get_srcdir # Slurp in consensus.h contents _consensus_h_fh = open(os.path.join(get_srcdir(), 'src', 'consensus', 'consensus.h'), 'rt') _consensus_h_contents = _consensus_h_fh.read() _consensus_h_fh.close() # This constant is currently needed to evaluate some that are formulas ONE_MEGABYTE = 1000000 # Extract relevant default values parameters # The maximum allowed block size before the fork LEGACY_MAX_BLOCK_SIZE = ONE_MEGABYTE # Default setting for maximum allowed size for a block, in bytes DEFAULT_MAX_BLOCK_SIZE = eval( re.search(r'DEFAULT_MAX_BLOCK_SIZE = (.+);',
# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Imports some application default values from source files outside the test framework, and defines equivalents of consensus parameters for the test framework. """ import os import re from test_framework.util import get_srcdir # Slurp in consensus.h contents _consensus_h_fh = open( os.path.join(get_srcdir(), 'src', 'consensus', 'consensus.h'), 'rt') _consensus_h_contents = _consensus_h_fh.read() _consensus_h_fh.close() # This constant is currently needed to evaluate some that are formulas ONE_MEGABYTE = 1000000 # Extract relevant default values parameters # The maximum allowed block size before the fork LEGACY_MAX_BLOCK_SIZE = ONE_MEGABYTE # Default setting for maximum allowed size for a block, in bytes DEFAULT_MAX_BLOCK_SIZE = eval( re.search(r'DEFAULT_MAX_BLOCK_SIZE = (.+);', _consensus_h_contents).group(1))
# Copyright (c) 2017 The Bitcoin developers # Copyright (c) 2019 Bitcoin Association # Distributed under the Open BSV software license, see the accompanying file LICENSE. """ Imports some application default values from source files outside the test framework, and defines equivalents of consensus parameters for the test framework. """ import os import re from test_framework.util import get_srcdir # Slurp in policy.h contents _policy_h_fh = open(os.path.join(get_srcdir(), 'src', 'policy', 'policy.h'), 'rt') _policy_h_contents = _policy_h_fh.read() _policy_h_fh.close() # Slurp in chainparams.cpp contents _chainparams_cpp_fh = open( os.path.join(get_srcdir(), 'src', 'chainparams.cpp'), 'rt') _chainparams_cpp_contents = _chainparams_cpp_fh.read() _chainparams_cpp_fh.close() # Slurp in consensus.h contents _consensus_h_fh = open( os.path.join(get_srcdir(), 'src', 'consensus', 'consensus.h'), 'rt') _consensus_h_contents = _consensus_h_fh.read() _consensus_h_fh.close()
# Copyright (c) 2017 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Imports some application default values from source files outside the test framework, and defines equivalents of consensus parameters for the test framework. """ import os import re from test_framework.util import get_srcdir # Slurp in consensus.h contents _consensus_h_fh = open(os.path.join(get_srcdir(), 'src', 'consensus', 'consensus.h'), 'rt') _consensus_h_contents = _consensus_h_fh.read() _consensus_h_fh.close() # This constant is currently needed to evaluate some that are formulas ONE_MEGABYTE = 1000000 # Extract relevant default values parameters # The maximum allowed block size before the fork LEGACY_MAX_BLOCK_SIZE = ONE_MEGABYTE # Default setting for maximum allowed size for a block, in bytes DEFAULT_MAX_BLOCK_SIZE = eval( re.search(r'DEFAULT_MAX_BLOCK_SIZE = (.+);',
# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Imports some application default values from source files outside the test framework, and defines equivalents of consensus parameters for the test framework. """ import os import re from test_framework.util import get_srcdir # Slurp in consensus.h contents _consensus_h_fh = open( os.path.join(get_srcdir(), 'src', 'core', 'bitcoinconsensus', 'consensus', 'consensus.h'), 'rt') _consensus_h_contents = _consensus_h_fh.read() _consensus_h_fh.close() # This constant is currently needed to evaluate some that are formulas ONE_MEGABYTE = 1000000 # Extract relevant default values parameters # The maximum allowed block size before the fork LEGACY_MAX_BLOCK_SIZE = ONE_MEGABYTE # Default setting for maximum allowed size for a block, in bytes DEFAULT_MAX_BLOCK_SIZE = eval( re.search(r'DEFAULT_MAX_BLOCK_SIZE = (.+);',
# Copyright (c) 2017 The Bitcoin developers # Copyright (c) 2019 Bitcoin Association # Distributed under the Open BSV software license, see the accompanying file LICENSE. """ Imports some application default values from source files outside the test framework, and defines equivalents of consensus parameters for the test framework. """ import os import re from test_framework.util import get_srcdir # Slurp in policy.h contents _policy_h_fh = open(os.path.join(get_srcdir(), 'src', 'policy', 'policy.h'), 'rt') _policy_h_contents = _policy_h_fh.read() _policy_h_fh.close() # Slurp in chainparams.cpp contents _chainparams_cpp_fh = open( os.path.join(get_srcdir(), 'src', 'chainparams.cpp'), 'rt') _chainparams_cpp_contents = _chainparams_cpp_fh.read() _chainparams_cpp_fh.close() # Slurp in consensus.h contents _consensus_h_fh = open( os.path.join(get_srcdir(), 'src', 'consensus', 'consensus.h'), 'rt') _consensus_h_contents = _consensus_h_fh.read() _consensus_h_fh.close()