Tests: Add test for getdifficulty#10229
Conversation
There was a problem hiding this comment.
flake8 warning: E501 line too long (85 > 79 characters)
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
adding to the comment, thanks!
There was a problem hiding this comment.
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.
Is there a cleverer way to do this?
bfd615c to
a75c80e
Compare
|
Fixed issues, rebased to master. |
8fd75de to
ba2b295
Compare
jnewbery
left a comment
There was a problem hiding this comment.
Looks good. Tested ACK ba2b295093d5f5cad4701f9ca86b2c83e60c3ef9.
A few nits which you can take or leave.
There was a problem hiding this comment.
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.
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)
There was a problem hiding this comment.
I'd prefer a more descriptive name than res, perhaps difficulty? (or even combine with the line below)
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.