|
| 1 | +#!/usr/bin/env python3 |
| 2 | +# Copyright (c) 2018-2018 The Bitcoin Core developers |
| 3 | +# Distributed under the MIT software license, see the accompanying |
| 4 | +# file COPYING or http://www.opensource.org/licenses/mit-license.php. |
| 5 | +"""Test genesis block hash |
| 6 | +""" |
| 7 | + |
| 8 | +from test_framework.test_framework import BitcoinTestFramework |
| 9 | +from test_framework.util import ( |
| 10 | + assert_equal, |
| 11 | +) |
| 12 | + |
| 13 | +class GenesisHashTest(BitcoinTestFramework): |
| 14 | + |
| 15 | + def add_options(self, parser): |
| 16 | + parser.add_argument('--config_path', dest='config_path', default='', |
| 17 | + help='Path to write down the generated config for signet into files.') |
| 18 | + |
| 19 | + def set_test_params(self): |
| 20 | + self.chain = 'signet' |
| 21 | + self.setup_clean_chain = True |
| 22 | + self.num_nodes = 2 |
| 23 | + self.extra_args = [ |
| 24 | + [ |
| 25 | + '-con_genesis_style=default_style', |
| 26 | + ], |
| 27 | + [ |
| 28 | + '-con_genesis_style=regtest2_style', |
| 29 | + ], |
| 30 | + ] |
| 31 | + |
| 32 | + def setup_network(self): |
| 33 | + self.add_nodes(self.num_nodes, self.extra_args) |
| 34 | + |
| 35 | + def run_test(self): |
| 36 | + |
| 37 | + self.log.info('Check genesis style default_style...') |
| 38 | + self.start_node(0) |
| 39 | + assert_equal(self.nodes[0].getblockhash(0), 'c03f16ae9e2980de2b61fd6dc84af8ac4a37bea928af632166a6b36c5c871ddd') |
| 40 | + |
| 41 | + self.log.info('Check genesis style regtest2_style...') |
| 42 | + self.start_node(1) |
| 43 | + assert_equal(self.nodes[1].getblockhash(0), '82ba4b06cffb29f7c5426aa519ecb8e9a2b28b1df11a65c155b5054cca67583d') |
| 44 | + |
| 45 | +if __name__ == '__main__': |
| 46 | + GenesisHashTest().main() |
0 commit comments