Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Handle import failures in test_importRawBlock #5647

Merged
merged 3 commits into from
Jul 4, 2019
Merged

Conversation

gumb0
Copy link
Member

@gumb0 gumb0 commented Jul 3, 2019

Fixes #5646

@gumb0 gumb0 force-pushed the importrawblock-failure branch from fbac83d to 75cc789 Compare July 3, 2019 14:03
@codecov-io
Copy link

codecov-io commented Jul 3, 2019

Codecov Report

Merging #5647 into master will increase coverage by 0.04%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5647      +/-   ##
==========================================
+ Coverage   62.74%   62.78%   +0.04%     
==========================================
  Files         348      348              
  Lines       29689    29709      +20     
  Branches     3345     3346       +1     
==========================================
+ Hits        18627    18654      +27     
+ Misses       9846     9841       -5     
+ Partials     1216     1214       -2

@@ -729,7 +729,33 @@ BOOST_AUTO_TEST_CASE(test_importRawBlock)
Json::Value ret;
Json::Reader().parse(c_genesisConfigString, ret);
rpcClient->test_setChainParams(ret);

string blockHash = rpcClient->test_importRawBlock(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test actually failed to import the block (difficulty was wrong in that block after changing difficulty rules for NoProof), but test_importRawBlock didn't report it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

difficulty rules are still checked for NoProof.
nonce and mixHash are not checked.

Copy link
Member Author

@gumb0 gumb0 Jul 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

difficulty rules are still checked for NoProof.

that's the reason why this test worked incorrectly (block was invalid, I guess you created it when there were no difficulty check in NoProof yet)

I changed it now to have correct difficulty.

@gumb0 gumb0 removed the in progress label Jul 3, 2019
@gumb0 gumb0 requested review from winsvega, chfast and halfalicious July 3, 2019 15:53
@gumb0 gumb0 force-pushed the importrawblock-failure branch from f9092c7 to 0473839 Compare July 4, 2019 09:19
@gumb0 gumb0 merged commit fe75b95 into master Jul 4, 2019
@gumb0 gumb0 deleted the importrawblock-failure branch July 4, 2019 11:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_importRawBlock doesn't handle errors properly
4 participants