mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Merge bitcoin/bitcoin#18933: rpc: Add submit option to generateblock
fa18504d57rpc: Add submit option to generateblock (MarcoFalke)fab9a08e14refactor: Replace block_hash with block_out (MarcoFalke) Pull request description: When submit is turned off, a block can be generated and returned as hex, to be used for further tests. For example, it can be submitted on a different node, on a different interface (like p2p), or just never submitted and be used for other testing purposes. ACKs for top commit: instagibbs: ACKfa18504d57TheCharlatan: tACKfa18504d57Tree-SHA512: 1b2ab6b71bb7e155c6482d75f5373f4e77de6446cb16bc2dfd19e7a4075b3a6ad87d7ad7a049a9eed934cb71574acfd27202f54c8bb3b03fac869f2e95db7ee5
This commit is contained in:
@@ -29,8 +29,13 @@ class RPCGenerateTest(BitcoinTestFramework):
|
||||
node = self.nodes[0]
|
||||
miniwallet = MiniWallet(node)
|
||||
|
||||
self.log.info('Generate an empty block to address')
|
||||
self.log.info('Mine an empty block to address and return the hex')
|
||||
address = miniwallet.get_address()
|
||||
generated_block = self.generateblock(node, output=address, transactions=[], submit=False)
|
||||
node.submitblock(hexdata=generated_block['hex'])
|
||||
assert_equal(generated_block['hash'], node.getbestblockhash())
|
||||
|
||||
self.log.info('Generate an empty block to address')
|
||||
hash = self.generateblock(node, output=address, transactions=[])['hash']
|
||||
block = node.getblock(blockhash=hash, verbose=2)
|
||||
assert_equal(len(block['tx']), 1)
|
||||
|
||||
Reference in New Issue
Block a user