Changeset View
Changeset View
Standalone View
Standalone View
contrib/devtools/chainparams/generate_chainparams_constants.py
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | def main(): | ||||
print('''\ | print('''\ | ||||
#ifndef BITCOIN_CHAINPARAMSCONSTANTS_H | #ifndef BITCOIN_CHAINPARAMSCONSTANTS_H | ||||
#define BITCOIN_CHAINPARAMSCONSTANTS_H | #define BITCOIN_CHAINPARAMSCONSTANTS_H | ||||
/** | /** | ||||
* Chain params constants for each tracked chain. | * Chain params constants for each tracked chain. | ||||
* @{} by contrib/devtools/chainparams/generate_chainparams_constants.py | * @{} by contrib/devtools/chainparams/generate_chainparams_constants.py | ||||
*/ | */ | ||||
#include <primitives/blockhash.h> | |||||
#include <uint256.h> | #include <uint256.h> | ||||
namespace ChainParamsConstants {{ | namespace ChainParamsConstants {{ | ||||
const uint256 MAINNET_DEFAULT_ASSUME_VALID = uint256S("{}"); | const BlockHash MAINNET_DEFAULT_ASSUME_VALID = BlockHash::fromHex("{}"); | ||||
const uint256 MAINNET_MINIMUM_CHAIN_WORK = uint256S("{}"); | const uint256 MAINNET_MINIMUM_CHAIN_WORK = uint256S("{}"); | ||||
const uint256 TESTNET_DEFAULT_ASSUME_VALID = uint256S("{}"); | const BlockHash TESTNET_DEFAULT_ASSUME_VALID = BlockHash::fromHex("{}"); | ||||
const uint256 TESTNET_MINIMUM_CHAIN_WORK = uint256S("{}"); | const uint256 TESTNET_MINIMUM_CHAIN_WORK = uint256S("{}"); | ||||
}} // namespace ChainParamsConstants | }} // namespace ChainParamsConstants | ||||
#endif // BITCOIN_CHAINPARAMSCONSTANTS_H\ | #endif // BITCOIN_CHAINPARAMSCONSTANTS_H\ | ||||
'''.format( | '''.format( | ||||
# 'generated' is split out so this file is not identified as generated. | # 'generated' is split out so this file is not identified as generated. | ||||
"generated", | "generated", | ||||
*process_constants(indir, 'chainparams_main.txt'), | *process_constants(indir, 'chainparams_main.txt'), | ||||
*process_constants(indir, 'chainparams_test.txt')) | *process_constants(indir, 'chainparams_test.txt')) | ||||
) | ) | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
main() | main() |