MCPcopy Create free account
hub / github.com/ElementsProject/elements / assert_template

Function assert_template

test/functional/feature_block_subsidy.py:19–27  ·  view source on GitHub ↗
(node, block, expect, rehash=True)

Source from the content-addressed store, hash-verified

17 return b2a_hex(b).decode('ascii')
18
19def 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
29class BlockSubsidyTest(BitcoinTestFramework):
30 def set_test_params(self):

Callers 1

run_testMethod · 0.70

Calls 5

assert_equalFunction · 0.90
b2xFunction · 0.70
calc_merkle_rootMethod · 0.45
calc_sha256Method · 0.45
serializeMethod · 0.45

Tested by

no test coverage detected