mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-28 13:32:53 +02:00
Use COINBASE_MATURITY constant in functional tests.
This commit is contained in:
@@ -31,6 +31,7 @@ Start three nodes:
|
||||
"""
|
||||
|
||||
from test_framework.blocktools import (
|
||||
COINBASE_MATURITY,
|
||||
create_block,
|
||||
create_coinbase,
|
||||
)
|
||||
@@ -161,8 +162,8 @@ class AssumeValidTest(BitcoinTestFramework):
|
||||
|
||||
# Send blocks to node0. Block 102 will be rejected.
|
||||
self.send_blocks_until_disconnected(p2p0)
|
||||
self.wait_until(lambda: self.nodes[0].getblockcount() >= 101)
|
||||
assert_equal(self.nodes[0].getblockcount(), 101)
|
||||
self.wait_until(lambda: self.nodes[0].getblockcount() >= COINBASE_MATURITY + 1)
|
||||
assert_equal(self.nodes[0].getblockcount(), COINBASE_MATURITY + 1)
|
||||
|
||||
# Send all blocks to node1. All blocks will be accepted.
|
||||
for i in range(2202):
|
||||
@@ -173,8 +174,8 @@ class AssumeValidTest(BitcoinTestFramework):
|
||||
|
||||
# Send blocks to node2. Block 102 will be rejected.
|
||||
self.send_blocks_until_disconnected(p2p2)
|
||||
self.wait_until(lambda: self.nodes[2].getblockcount() >= 101)
|
||||
assert_equal(self.nodes[2].getblockcount(), 101)
|
||||
self.wait_until(lambda: self.nodes[2].getblockcount() >= COINBASE_MATURITY + 1)
|
||||
assert_equal(self.nodes[2].getblockcount(), COINBASE_MATURITY + 1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Reference in New Issue
Block a user