aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-10-02 14:48:37 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2017-10-02 14:48:59 +0200
commit557aba6ce7da8642ee6931ae37d33bfa25f3dfd0 (patch)
treec4ee4b82b3848162bfc38dd6096d4ffe41550e11 /test/functional
parent10bee0dd4f37eb6cb7a0f1d565fa0fecf8109c35 (diff)
parent49f869fe91716785b3276925d64bf8955feff69f (diff)
Merge #11399: Fix bip68-sequence rpc test
49f869f Fix bip68-sequence rpc test (Johnson Lau) Pull request description: The test mined 1 extra block for the ACTIVE state. Test added to catch the right moment of LOCKED_IN->ACTIVE transaction Tree-SHA512: a42477cf0b137e7e3b7c6c7b2530101cfad4e4f59866170b8fc0d655c43b3144aad6bca4287a4a8df4c28d7cf08d3f8df166975ad2e8dcb7d2cc15de60cf11cd
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/bip68-sequence.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/functional/bip68-sequence.py b/test/functional/bip68-sequence.py
index 3818287209..74f51d8cfb 100755
--- a/test/functional/bip68-sequence.py
+++ b/test/functional/bip68-sequence.py
@@ -369,11 +369,14 @@ class BIP68Test(BitcoinTestFramework):
def activateCSV(self):
# activation should happen at block height 432 (3 periods)
+ # getblockchaininfo will show CSV as active at block 431 (144 * 3 -1) since it's returning whether CSV is active for the next block.
min_activation_height = 432
height = self.nodes[0].getblockcount()
- assert(height < min_activation_height)
- self.nodes[0].generate(min_activation_height-height)
- assert(get_bip9_status(self.nodes[0], 'csv')['status'] == 'active')
+ assert_greater_than(min_activation_height - height, 2)
+ self.nodes[0].generate(min_activation_height - height - 2)
+ assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], "locked_in")
+ self.nodes[0].generate(1)
+ assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], "active")
sync_blocks(self.nodes)
# Use self.nodes[1] to test that version 2 transactions are standard.