-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Tests: Add test for getdifficulty #10229
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
Conversation
test/functional/blockchain.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.
Why this change?
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.
flake8 warning: E501 line too long (85 > 79 characters)
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.
My personal preference is to ignore the 'line too long' warning. Nothing wrong with going over 79 character lines in my opinion (but we don't have a style guide for functional tests, so entirely up to you)
test/functional/blockchain.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.
Mention the getdifficulty RPC test in the top level comment or remove the list of tested methods there.
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.
adding to the comment, thanks!
test/functional/blockchain.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.
Can you move the def after the _test_getblockheader so it is ordered the same as it is called?
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.
Yep, will do.
test/functional/blockchain.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.
Ugh.
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.
Is there a cleverer way to do this?
bfd615c to
a75c80e
Compare
|
Fixed issues, rebased to master. |
8fd75de to
ba2b295
Compare
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.
ACK 821dd5e
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.
Looks good. Tested ACK ba2b295093d5f5cad4701f9ca86b2c83e60c3ef9.
A few nits which you can take or leave.
test/functional/blockchain.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.
Might as well fix this docstring while you're at it. The following RPCs are also tested:
- getbestblockhash
- getblockhash
- getblockheader
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.
good idea.
test/functional/blockchain.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.
My personal preference is to ignore the 'line too long' warning. Nothing wrong with going over 79 character lines in my opinion (but we don't have a style guide for functional tests, so entirely up to you)
test/functional/blockchain.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.
I'd prefer a more descriptive name than res, perhaps difficulty? (or even combine with the line below)
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.
Makes sense.
Test added to blockchain.py as adding a new test to reduce test run time.
ba2b295 to
821dd5e
Compare
|
Fixed nits and squashed. |
821dd5e Tests: Add test for getdifficulty (Jimmy Song) Tree-SHA512: 3da78c4f88efdaab8374582cda606620beb2f1e9a93119a72b67572702c17c36b68c3abf9d466e8c7fb8ba9e8afa9a172e454c553df10d3054f19b3282d3097b
821dd5e Tests: Add test for getdifficulty (Jimmy Song) Tree-SHA512: 3da78c4f88efdaab8374582cda606620beb2f1e9a93119a72b67572702c17c36b68c3abf9d466e8c7fb8ba9e8afa9a172e454c553df10d3054f19b3282d3097b
Test added to blockchain.py as adding a new test to reduce test run time.