Skip to content
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

Add total difficulty property to Block<T> #917

Merged
merged 6 commits into from
Jul 10, 2020

Conversation

limebell
Copy link
Member

@limebell limebell commented Jul 8, 2020

Block now has total difficulty property, thus:

  • Block<T>.Mine() takes total difficulty of previous block.
  • BlockPolicy<T> now checks validity of total difficulty: (total difficulty = difficulty + previous total difficulty)

This closes #666.

@CLAassistant
Copy link

CLAassistant commented Jul 8, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@moreal moreal left a comment

Choose a reason for hiding this comment

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

I'll review further more

CHANGES.md Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 8, 2020

Codecov Report

Merging #917 into master will decrease coverage by 1.06%.
The diff coverage is 92.61%.

@@            Coverage Diff             @@
##           master     #917      +/-   ##
==========================================
- Coverage   87.82%   86.76%   -1.07%     
==========================================
  Files         258      235      -23     
  Lines       23968    23419     -549     
==========================================
- Hits        21051    20319     -732     
- Misses       1516     1695     +179     
- Partials     1401     1405       +4     
Impacted Files Coverage Δ
Libplanet.Tests/Net/SwarmTest.cs 94.57% <ø> (ø)
Libplanet.Tests/TestUtils.cs 87.06% <50.00%> (-0.76%) ⬇️
Libplanet/Blockchain/BlockChain.cs 90.08% <50.00%> (-0.10%) ⬇️
Libplanet/Blocks/Block.cs 85.22% <66.66%> (-0.44%) ⬇️
...net/Blocks/InvalidBlockTotalDifficultyException.cs 71.42% <71.42%> (ø)
Libplanet.Tests/Blocks/BlockHeaderTest.cs 71.65% <81.81%> (+2.49%) ⬆️
Libplanet.Tests/Blocks/BlockTest.cs 98.35% <96.19%> (-0.23%) ⬇️
...lanet.Tests/Blockchain/Policies/BlockPolicyTest.cs 97.84% <100.00%> (+0.27%) ⬆️
Libplanet/Blockchain/Policies/BlockPolicy.cs 85.96% <100.00%> (+1.65%) ⬆️
Libplanet/Blocks/BlockHeader.cs 92.94% <100.00%> (+1.21%) ⬆️
... and 43 more

@limebell limebell requested review from moreal and dahlia July 8, 2020 09:32
Libplanet/Blockchain/Policies/BlockPolicy.cs Outdated Show resolved Hide resolved
Libplanet/Blocks/BlockHeader.cs Outdated Show resolved Hide resolved
longfin
longfin previously approved these changes Jul 9, 2020
earlbread
earlbread previously approved these changes Jul 9, 2020
dahlia
dahlia previously approved these changes Jul 9, 2020
@moreal moreal requested a review from longfin July 9, 2020 08:08
moreal
moreal previously approved these changes Jul 9, 2020
@limebell limebell dismissed stale reviews from dahlia and earlbread via 3408b57 July 9, 2020 10:04
dahlia
dahlia previously approved these changes Jul 9, 2020
earlbread
earlbread previously approved these changes Jul 9, 2020
longfin
longfin previously approved these changes Jul 9, 2020
riemannulus
riemannulus previously approved these changes Jul 10, 2020
@limebell limebell merged commit 24fa5c5 into planetarium:master Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add total difficulty property to block
7 participants