-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Fix bip68-sequence rpc test #11399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bip68-sequence rpc test #11399
Conversation
promag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 25bd48f.
test/functional/bip68-sequence.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, spaces around operators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, prefer assert_greater_than() where possible (since it will print the result of both sides of the inequality if the assert fails)
jnewbery
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK. Some nits inline.
test/functional/bip68-sequence.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, prefer assert_greater_than() where possible (since it will print the result of both sides of the inequality if the assert fails)
test/functional/bip68-sequence.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer assert_equal()
test/functional/bip68-sequence.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this could do with more commenting. Activation happens at the end of 3 periods since:
- BIP68 bit is not yet defined in period 1
- Signaling takes place in period 2
- BIP68 is locked in during period 3.
getblockchaininfo will show BIP68 as active on at block 431 (144 * 3 -1) since it's returning whether BIP68 is active for the next block.
|
@jnewbery fixed |
jnewbery
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One taste nit inline.
Obviously up to you whether you think that's clearer or not.
Tested ACK 49f869f either way.
| 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely a matter of personal taste, but:
assert_greater_than(min_activation_height - 2, height)seems to me to convey the meaning better: that the current height is less than (activation height - 2).
|
utACK 49f869f |
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
Github-Pull: bitcoin#11399 Rebased-From: 49f869f
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
The test mined 1 extra block for the ACTIVE state. Test added to catch the right moment of LOCKED_IN->ACTIVE transaction