rpc: Add submit option to generateblock

This commit is contained in:
MarcoFalke committed 2023-03-10 10:39:14 +01:00
1 parent fab9a08e14
commit fa18504d57
3 files changed
+21 -4

No files matched your search

+6 -1
View File
@@ -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)