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

Introduce sdk.NewCoins #3813

Merged
merged 9 commits into from
Mar 8, 2019
Merged

Introduce sdk.NewCoins #3813

merged 9 commits into from
Mar 8, 2019

Conversation

alessio
Copy link
Contributor

@alessio alessio commented Mar 6, 2019

Replace sdk.Coins{} declarations with NewCoins() calls
that sanitize and validate input coins to construct a safe,
valid coin set.

Ref #2835

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote tests
  • Updated relevant documentation (docs/)
  • Added entries in PENDING.md with issue #
  • rereviewed Files changed in the github PR explorer

For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@alessio alessio changed the title Alessio/coins constructor Introduce sdk.NewCoins Mar 6, 2019
@alessio alessio marked this pull request as ready for review March 6, 2019 16:00
@jackzampolin
Copy link
Member

A constructor for Coins is something we have talked about for a while. This is a great add.

Replaces literal sdk.Coins{}, guarantees coins are sorted
and panics if there are duplicates.
@codecov
Copy link

codecov bot commented Mar 6, 2019

Codecov Report

Merging #3813 into develop will increase coverage by 0.06%.
The diff coverage is 90.32%.

@@             Coverage Diff             @@
##           develop    #3813      +/-   ##
===========================================
+ Coverage    60.86%   60.92%   +0.06%     
===========================================
  Files          192      192              
  Lines        14288    14307      +19     
===========================================
+ Hits          8696     8717      +21     
+ Misses        5025     5024       -1     
+ Partials       567      566       -1

Copy link
Contributor

@rigelrozanski rigelrozanski left a comment

Choose a reason for hiding this comment

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

couple comments which would be nice to address, but looks good

types/coin_test.go Outdated Show resolved Hide resolved
x/bank/msgs_test.go Outdated Show resolved Hide resolved
types/coin.go Outdated Show resolved Hide resolved
types/coin.go Outdated Show resolved Hide resolved
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.

Few minor bits of feedback, but otherwise looks good!

alexanderbez and others added 3 commits March 7, 2019 20:32
Co-Authored-By: alessio <quadrispro@ubuntu.com>
Co-Authored-By: alessio <quadrispro@ubuntu.com>
Co-Authored-By: alessio <quadrispro@ubuntu.com>
Copy link
Member

@jackzampolin jackzampolin left a comment

Choose a reason for hiding this comment

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

Read through this yesterday. Looks great! Gets a 👍 from me!

types/coin_test.go Outdated Show resolved Hide resolved
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.

4 participants