Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_generateblock.py
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
assert_equal(block['tx'][0]['vout'][0]['scriptPubKey'] | assert_equal(block['tx'][0]['vout'][0]['scriptPubKey'] | ||||
['addresses'][0], combo_address) | ['addresses'][0], combo_address) | ||||
# Generate 110 blocks to spend | # Generate 110 blocks to spend | ||||
node.generatetoaddress(110, address) | node.generatetoaddress(110, address) | ||||
# Generate some extra mempool transactions to verify they don't get | # Generate some extra mempool transactions to verify they don't get | ||||
# mined | # mined | ||||
for i in range(10): | for _ in range(10): | ||||
node.sendtoaddress(address, 1000) | node.sendtoaddress(address, 1000) | ||||
self.log.info('Generate block with txid') | self.log.info('Generate block with txid') | ||||
txid = node.sendtoaddress(address, 1000000) | txid = node.sendtoaddress(address, 1000000) | ||||
hash = node.generateblock(address, [txid])['hash'] | hash = node.generateblock(address, [txid])['hash'] | ||||
block = node.getblock(hash, 1) | block = node.getblock(hash, 1) | ||||
assert_equal(len(block['tx']), 2) | assert_equal(len(block['tx']), 2) | ||||
assert_equal(block['tx'][1], txid) | assert_equal(block['tx'][1], txid) | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |