Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Problem (Fix #1095): Reward distribution don't increase staking account's nonce #1100

Merged
merged 1 commit into from
Feb 18, 2020

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Feb 18, 2020

Solution:

  • Increase nonce by one when add reward.

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

unit test fails -- I think it on L203 you can increase the nonce that the transaction is created with.
also, it can be good to add a unit test that only captures this bug (e.g. do a reward distribution and check that nonces of affected accounts were updated)

…king account's nonce

Solution:
- Increase nonce by one when add reward.
@yihuang
Copy link
Collaborator Author

yihuang commented Feb 18, 2020

unit test fails -- I think it on L203 you can increase the nonce that the transaction is created with.
also, it can be good to add a unit test that only captures this bug (e.g. do a reward distribution and check that nonces of affected accounts were updated)

Done, add checking of nonce in the standard reward distribution test case.

@codecov
Copy link

codecov bot commented Feb 18, 2020

Codecov Report

Merging #1100 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1100      +/-   ##
==========================================
- Coverage   66.24%   66.24%   -0.01%     
==========================================
  Files         145      145              
  Lines       18840    18843       +3     
==========================================
+ Hits        12481    12482       +1     
- Misses       6359     6361       +2
Impacted Files Coverage Δ
chain-abci/tests/validator_changes.rs 100% <100%> (ø) ⬆️
chain-core/src/state/account.rs 76.67% <100%> (+0.06%) ⬆️
chain-abci/src/app/rewards.rs 98.37% <100%> (+0.02%) ⬆️
chain-core/src/tx/fee/mod.rs 87% <0%> (-0.5%) ⬇️
chain-core/src/common/merkle_tree.rs 98.55% <0%> (-0.25%) ⬇️

@tomtau
Copy link
Contributor

tomtau commented Feb 18, 2020

bors r+

bors bot added a commit that referenced this pull request Feb 18, 2020
1099: Problem:(fix #1027) inputted coin value in client-cli is not confirmed r=tomtau a=linfeng-crypto

solution: confirm coin input in client-cli

1100: Problem (Fix #1095): Reward distribution don't increase staking account's nonce r=tomtau a=yihuang

Solution:
- Increase nonce by one when add reward.

Co-authored-by: linfeng <linfeng@crypto.com>
Co-authored-by: yihuang <huang@crypto.com>
@bors
Copy link
Contributor

bors bot commented Feb 18, 2020

@bors bors bot merged commit a996b51 into crypto-com:master Feb 18, 2020
@yihuang yihuang deleted the issue1095 branch February 19, 2020 01:19
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.

2 participants