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

Avoid mutation of roundRewards in rewardsAtRound() - Closes #3242 #3253

Merged
merged 2 commits into from Apr 3, 2019

Conversation

Projects
4 participants
@diego-G
Copy link
Member

commented Apr 3, 2019

What was the problem?

rewardsAtRound() executes a piece of code when there is an exception in rounds. This code wasn't covered by unit tests.

How did I fix it?

Cloning roundRewards variable to avoid mutation when a round exception exists.

How to test it?

framework/test/mocha/unit/modules/chain/logic/round.js

Review checklist

  • The PR resolves #3242
  • All new code is covered with unit tests
  • All new code was formatted with Prettier
  • Linting passes
  • Tests pass
  • Commit messages follow the commit guidelines
  • Documentation has been added/updated

@diego-G diego-G self-assigned this Apr 3, 2019

@diego-G diego-G added this to Pending Review in Version 1.6.0 via automation Apr 3, 2019

@diego-G diego-G requested review from lsilvs and ManuGowda Apr 3, 2019

@diego-G diego-G requested a review from lsilvs Apr 3, 2019

@lsilvs
Copy link
Member

left a comment

I've added a suggestion change as the current test implementation will result in adding the key 1: undefined to global.exceptions.rounds.

@lsilvs lsilvs changed the base branch from development to 1.6.0 Apr 3, 2019

@diego-G diego-G force-pushed the 3242-fix_logic_round_rewardsAtRound branch from 970db11 to 8f0a3f5 Apr 3, 2019

@diego-G diego-G force-pushed the 3242-fix_logic_round_rewardsAtRound branch from 8f0a3f5 to 1be411c Apr 3, 2019

@diego-G diego-G requested review from lsilvs and shuse2 Apr 3, 2019

@lsilvs

lsilvs approved these changes Apr 3, 2019

@shuse2

shuse2 approved these changes Apr 3, 2019

@shuse2 shuse2 added ready and removed 👁 pending review labels Apr 3, 2019

@shuse2 shuse2 merged commit 13130cb into 1.6.0 Apr 3, 2019

3 checks passed

jenkins-ci/lisk-core This commit looks good
Details
jenkins-ci/lisk-core-network This commit looks good
Details
security/snyk - package.json (LiskHQ) No manifest changes detected

Version 1.6.0 automation moved this from Pending Review to Closed PRs Apr 3, 2019

@shuse2 shuse2 deleted the 3242-fix_logic_round_rewardsAtRound branch Apr 3, 2019

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.