-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Improve getchaintxstats test coverage #12083
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
a5667a3
to
5b95f96
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 5b95f96871a33aada918c54c4eff263cb3c55fec -- refactoring looks like it shouldn't change the logic; extra test cases look good.
test/functional/blockchain.py
Outdated
assert_raises_rpc_error(-5, "Block not found", self.nodes[0].getchaintxstats, blockhash='0') | ||
blockhash = self.nodes[0].generate(1)[0]; | ||
self.nodes[0].invalidateblock(blockhash) | ||
assert_raises_rpc_error(-8, "Block is not in main chain", self.nodes[0].getchaintxstats, blockhash=blockhash) |
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.
Wouldn't it be better to do:
blockhash = self.nodes[0].getblockhash(200)
self.nodes[0].invalidateblock(blockhash)
assert_raises_rpc_error()
self.nodes[0].reconsiderblock(blockhash)
and drop the invalidateblock in _test_gettxoutsetinfo()?
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.
Done, I'll squash once it's green.
@ajtowns Thanks for the review.
If this is a concern for others, I can take that commit to a new PR. |
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 590aa8f1b56cf1a8d82bff41a513cf5f3f530e4a
590aa8f
to
e805507
Compare
e805507
to
57e6786
Compare
Rebased to fix conflict of test file Best reviewed with |
57e6786 qa: Improve getchaintxstats functional test (João Barbosa) 501b439 rpc: Refactor blockhash parse in getchaintxstats (João Barbosa) Pull request description: Tree-SHA512: 61dec5cb68122998df7ec7b5239830f3caf0fe7185c107a66f27653ab2531a800db19a09050671b6fa8dbb5b53181da861eb31199c79d8635f246ccfa0d10efd
57e6786 qa: Improve getchaintxstats functional test (João Barbosa) 501b439 rpc: Refactor blockhash parse in getchaintxstats (João Barbosa) Pull request description: Tree-SHA512: 61dec5cb68122998df7ec7b5239830f3caf0fe7185c107a66f27653ab2531a800db19a09050671b6fa8dbb5b53181da861eb31199c79d8635f246ccfa0d10efd
57e6786 qa: Improve getchaintxstats functional test (João Barbosa) 501b439 rpc: Refactor blockhash parse in getchaintxstats (João Barbosa) Pull request description: Tree-SHA512: 61dec5cb68122998df7ec7b5239830f3caf0fe7185c107a66f27653ab2531a800db19a09050671b6fa8dbb5b53181da861eb31199c79d8635f246ccfa0d10efd
57e6786 qa: Improve getchaintxstats functional test (João Barbosa) 501b439 rpc: Refactor blockhash parse in getchaintxstats (João Barbosa) Pull request description: Tree-SHA512: 61dec5cb68122998df7ec7b5239830f3caf0fe7185c107a66f27653ab2531a800db19a09050671b6fa8dbb5b53181da861eb31199c79d8635f246ccfa0d10efd
57e6786 qa: Improve getchaintxstats functional test (João Barbosa) 501b439 rpc: Refactor blockhash parse in getchaintxstats (João Barbosa) Pull request description: Tree-SHA512: 61dec5cb68122998df7ec7b5239830f3caf0fe7185c107a66f27653ab2531a800db19a09050671b6fa8dbb5b53181da861eb31199c79d8635f246ccfa0d10efd
57e6786 qa: Improve getchaintxstats functional test (João Barbosa) 501b439 rpc: Refactor blockhash parse in getchaintxstats (João Barbosa) Pull request description: Tree-SHA512: 61dec5cb68122998df7ec7b5239830f3caf0fe7185c107a66f27653ab2531a800db19a09050671b6fa8dbb5b53181da861eb31199c79d8635f246ccfa0d10efd
No description provided.