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

Made BlockChain<T>.GetNonce() to refer staged transactions #270

Merged

Conversation

Projects
None yet
4 participants
@longfin
Copy link
Member

commented Jun 3, 2019

This PR adds includeStage to BlockChain<T>.GetNonce() to refer staged transactions during nonce computation.

I've changed BlockChain<T>.GetNonce() to refer staged transactions without any other options.

@longfin longfin force-pushed the longfin:feature/get-nonce-include-staging branch from 7765313 to ed25fa0 Jun 3, 2019

@longfin longfin marked this pull request as ready for review Jun 3, 2019

@codecov

This comment has been minimized.

Copy link

commented Jun 3, 2019

Codecov Report

Merging #270 into master will increase coverage by 0.05%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #270      +/-   ##
==========================================
+ Coverage   86.96%   87.01%   +0.05%     
==========================================
  Files         180      180              
  Lines       11389    11432      +43     
==========================================
+ Hits         9904     9948      +44     
  Misses       1241     1241              
+ Partials      244      243       -1
Impacted Files Coverage Δ
Libplanet.Tests/Blockchain/BlockChainTest.cs 98.95% <100%> (+0.04%) ⬆️
Libplanet/Blockchain/BlockChain.cs 96.42% <100%> (+0.13%) ⬆️
Libplanet/Crypto/PrivateKey.cs 85.58% <0%> (+0.9%) ⬆️
@codecov-io

This comment has been minimized.

Copy link

commented Jun 3, 2019

Codecov Report

Merging #270 into master will increase coverage by 0.15%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #270      +/-   ##
==========================================
+ Coverage   86.96%   87.11%   +0.15%     
==========================================
  Files         180      180              
  Lines       11389    11444      +55     
==========================================
+ Hits         9904     9970      +66     
+ Misses       1241     1231      -10     
+ Partials      244      243       -1
Impacted Files Coverage Δ
Libplanet.Tests/Blockchain/BlockChainTest.cs 98.96% <100%> (+0.05%) ⬆️
Libplanet/Blockchain/BlockChain.cs 96.47% <100%> (+0.18%) ⬆️
Libplanet/Net/Swarm.cs 75.76% <0%> (+0.8%) ⬆️
Libplanet/Crypto/PrivateKey.cs 85.58% <0%> (+0.9%) ⬆️

@longfin longfin force-pushed the longfin:feature/get-nonce-include-staging branch from ed25fa0 to 0b89584 Jun 4, 2019

@longfin longfin force-pushed the longfin:feature/get-nonce-include-staging branch from 0b89584 to 007856b Jun 4, 2019

@longfin

This comment has been minimized.

Copy link
Member Author

commented Jun 4, 2019

I've added two changes.

  • Fixed bug that nonce validation ignores previous nonce.
  • Fixed to arrange the tx of the block to be mined in order of nonce.

@longfin longfin requested review from earlbread and dahlia Jun 4, 2019

@longfin longfin changed the title Add includeStage to BlockChain<T>.GetNonce() Made BlockChain<T>.GetNonce() to refer staged transactions Jun 4, 2019

@longfin

This comment has been minimized.

Copy link
Member Author

commented Jun 4, 2019

I've changed BlockChain.GetNonce() to refer staged transactions without any other options.

@dahlia

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

I've changed BlockChain.GetNonce() to refer staged transactions without any other options.

Could you let me know why did you removed that option?

@longfin

This comment has been minimized.

Copy link
Member Author

commented Jun 4, 2019

I've changed BlockChain.GetNonce() to refer staged transactions without any other options.

Could you let me know why did you removed that option?

  • It seemed that we would not have to keep the existing behavior without referencing the staged transactions
    • I did not come up with a scenario that required old behavior enough to provide the option separately
  • Also, I wanted to minimize the options that users could make mistakes
@dahlia
Copy link
Member

left a comment

Also, I wanted to minimize the options that users could make mistakes

Pair enough. In this perspective, we should eventually get rid of this method at all and make users able to make transactions without knowing the concept of tx nonce.

Show resolved Hide resolved CHANGES.md Outdated
Update CHANGES.md
Co-Authored-By: Hong Minhee <hong.minhee@gmail.com>
@dahlia

dahlia approved these changes Jun 4, 2019

@longfin longfin merged commit 36f7206 into planetarium:master Jun 4, 2019

16 checks passed

Travis CI - Pull Request Build Passed
Details
WIP Ready for review
Details
changelog This contains self-describing changelog.
Details
codecov/patch 100% of diff hit (target 86.96%)
Details
codecov/project 87.11% (+0.15%) compared to 8c845e6
Details
docs Libplanet docs generated by DocFX
Details
planetarium.libplanet Build #20190604.7 succeeded
Details
planetarium.libplanet (Linux_Mono) Linux_Mono succeeded
Details
planetarium.libplanet (Linux_NETCore) Linux_NETCore succeeded
Details
planetarium.libplanet (Windows_Mono) Windows_Mono succeeded
Details
planetarium.libplanet (Windows_NETCore) Windows_NETCore succeeded
Details
planetarium.libplanet (Windows_NETCore_coverage) Windows_NETCore_coverage succeeded
Details
planetarium.libplanet (Windows_NETFramework) Windows_NETFramework succeeded
Details
planetarium.libplanet (macOS_Mono) macOS_Mono succeeded
Details
planetarium.libplanet (macOS_NETCore) macOS_NETCore succeeded
Details
planetarium.libplanet (macOS_Unity) macOS_Unity succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.