aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpc_generate.py
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-03-10 10:40:26 +0100
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-03-10 10:39:14 +0100
commitfa18504d5767a40dc9827fb081633219bf251001 (patch)
tree773eb0b685bcbdd724886533eca5dbba27edc4a8 /test/functional/rpc_generate.py
parentfab9a08e145dc5a1d9576bf062473f1095b56a16 (diff)
rpc: Add submit option to generateblock
Diffstat (limited to 'test/functional/rpc_generate.py')
-rwxr-xr-xtest/functional/rpc_generate.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/functional/rpc_generate.py b/test/functional/rpc_generate.py
index 8948ccb48d..20f62079fd 100755
--- a/test/functional/rpc_generate.py
+++ b/test/functional/rpc_generate.py
@@ -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)