Skip to content

Commit 2d994c4

Browse files
committed
qa: adding test case for output value > input value out of range
1 parent 6165c80 commit 2d994c4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/functional/p2p_invalid_block.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def run_test(self):
4444
# Save the coinbase for later
4545
block1 = block
4646
tip = block.sha256
47-
node.p2p.send_blocks_and_test([block1], node, True)
47+
node.p2p.send_blocks_and_test([block1], node, success=True)
4848

4949
self.log.info("Mature the block.")
5050
node.generate(100)
@@ -135,5 +135,15 @@ def run_test(self):
135135
self.log.info("Test inflation by duplicating input")
136136
node.p2p.send_blocks_and_test([block4], node, success=False, reject_reason='bad-txns-inputs-duplicate')
137137

138+
self.log.info("Test output value > input value out of range")
139+
# Can be removed when 'feature_block.py' is added to the suite.
140+
tx4 = create_transaction(tx2, 0, b'\x51', 260 * COIN)
141+
block4 = create_block(tip, create_coinbase(height), block_time)
142+
block4.vtx.extend([tx4])
143+
block4.hashMerkleRoot = block4.calc_merkle_root()
144+
block4.rehash()
145+
block4.solve()
146+
node.p2p.send_blocks_and_test([block4], node, success=False, reject_reason='bad-txns-in-belowout')
147+
138148
if __name__ == '__main__':
139149
InvalidBlockRequestTest().main()

0 commit comments

Comments
 (0)