(node, block, expect, rehash=True)
| 17 | return b2a_hex(b).decode('ascii') |
| 18 | |
| 19 | def assert_template(node, block, expect, rehash=True): |
| 20 | # Re-set the block timestamp before every submission to avoid |
| 21 | # intermittent "time too old" failures in slow CI boxes |
| 22 | block.nTime = int(time()) + 1 |
| 23 | if rehash: |
| 24 | block.hashMerkleRoot = block.calc_merkle_root() |
| 25 | block.calc_sha256() |
| 26 | rsp = node.getblocktemplate({'data': b2x(block.serialize()), 'mode': 'proposal'}) |
| 27 | assert_equal(rsp, expect) |
| 28 | |
| 29 | class BlockSubsidyTest(BitcoinTestFramework): |
| 30 | def set_test_params(self): |
no test coverage detected