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

Move block validation code to BlockChain<T> #1010

Merged
merged 4 commits into from
Sep 18, 2020

Conversation

earlbread
Copy link
Contributor

This moves block validation code to BlockChain<T> from BlockPolicy<T> and also the methods of BlockPolicy<T> became to virtual so that it can be overridden.

dahlia
dahlia previously approved these changes Sep 18, 2020
Copy link
Contributor

@dahlia dahlia left a comment

Choose a reason for hiding this comment

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

Left comments, that are all trivial suggestions; feel free to ignore them.

<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition=" '$(MSBuildRuntimeType)'=='Mono' And
'$(BuildingByReSharper)'!='true'">
<PropertyGroup Condition=" '$(MSBuildRuntimeType)'=='Mono' And '$(BuildingByReSharper)'!='true'">
Copy link
Contributor

Choose a reason for hiding this comment

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

The changes in this file are apparently unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, but I changed it because Rider modifies this file whenever I add or remove files.

CHANGES.md Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
Libplanet/Blockchain/Policies/BlockPolicy.cs Show resolved Hide resolved
Libplanet/Blockchain/BlockChain.cs Outdated Show resolved Hide resolved
Libplanet/Blockchain/BlockChain.cs Outdated Show resolved Hide resolved
Libplanet/Blockchain/BlockChain.cs Outdated Show resolved Hide resolved
Libplanet/Blockchain/BlockChain.cs Outdated Show resolved Hide resolved
Libplanet/Blockchain/BlockChain.cs Outdated Show resolved Hide resolved
Libplanet/Blockchain/BlockChain.cs Outdated Show resolved Hide resolved
Co-authored-by: Hong Minhee (洪 民憙) <hong.minhee@gmail.com>
@codecov
Copy link

codecov bot commented Sep 18, 2020

Codecov Report

Merging #1010 into main will decrease coverage by 0.04%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1010      +/-   ##
==========================================
- Coverage   88.94%   88.89%   -0.05%     
==========================================
  Files         329      330       +1     
  Lines       29892    29883       -9     
==========================================
- Hits        26586    26565      -21     
- Misses       1741     1748       +7     
- Partials     1565     1570       +5     
Impacted Files Coverage Δ
...sts/Blockchain/BlockChainTest.ValidateNextBlock.cs 95.16% <ø> (ø)
Libplanet.Tests/Blockchain/BlockChainTest.cs 98.57% <ø> (-0.01%) ⬇️
...lanet.Tests/Blockchain/Policies/BlockPolicyTest.cs 95.83% <ø> (-2.46%) ⬇️
Libplanet.Tests/Store/StoreTest.cs 99.02% <ø> (ø)
Libplanet/Blockchain/BlockChain.cs 90.65% <ø> (-0.19%) ⬇️
Libplanet/Blockchain/Policies/BlockPolicy.cs 89.70% <ø> (+4.43%) ⬆️
Libplanet/Net/Swarm.cs 84.88% <0.00%> (-0.60%) ⬇️
Libplanet.RocksDBStore/RocksDBStore.cs 95.56% <0.00%> (-0.32%) ⬇️
... and 5 more

@earlbread earlbread merged commit c54cecd into planetarium:main Sep 18, 2020
@earlbread earlbread deleted the block-validation branch September 18, 2020 10:55
moreal added a commit to moreal/libplanet that referenced this pull request Dec 11, 2020
`BlockPolicy.ValidateNextBlock` has been become not to throw
`InvalidBlockStateRootHashException` since
planetarium#1010
moreal added a commit to moreal/libplanet that referenced this pull request Dec 11, 2020
`BlockPolicy.ValidateNextBlock` has been become not to throw
`InvalidBlockStateRootHashException` since
planetarium#1010

[skip changelog]
@moreal moreal mentioned this pull request Dec 11, 2020
moreal added a commit to moreal/libplanet that referenced this pull request Dec 11, 2020
`BlockPolicy.ValidateNextBlock` has been become not to throw
`InvalidBlockStateRootHashException` since
planetarium#1010

[skip changelog]
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.

5 participants