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

Fix for 6786 removeZeroCoins mutates original slice #6811

Merged

Conversation

iramiller
Copy link
Contributor

Description

This PR introduces two new unit test cases, one for Coin and one for DecCoin that fail on the existing code base in order to demonstrate the manipulation of the source array as described. The modifications to the Coin and DecCoin 'remove zero balance coin' functions address these issues and make the two added tests pass successfully.

closes: #6786


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@iramiller iramiller changed the title Fix for 6786 -- removeZeroCoins mutates original slice Fix for 6786 removeZeroCoins mutates original slice Jul 22, 2020
@codecov
Copy link

codecov bot commented Jul 22, 2020

Codecov Report

Merging #6811 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #6811      +/-   ##
==========================================
- Coverage   61.29%   61.29%   -0.01%     
==========================================
  Files         510      510              
  Lines       31640    31634       -6     
==========================================
- Hits        19395    19391       -4     
+ Misses      10729    10727       -2     
  Partials     1516     1516              

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Thanks @iramiller!

@iramiller iramiller marked this pull request as ready for review July 22, 2020 14:04
@amaury1093 amaury1093 added the A:automerge Automatically merge PR once all prerequisites pass. label Jul 28, 2020
@mergify mergify bot merged commit 282afcd into cosmos:master Jul 28, 2020
@iramiller iramiller deleted the 6786-removezerocoins-mutates-original-slice branch August 1, 2020 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

types: removeZeroCoins algorithm mutates the original slice
4 participants