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

Refactor crisis package using internal #4649

Merged
merged 5 commits into from
Jul 1, 2019

Conversation

alessio
Copy link
Contributor

@alessio alessio commented Jul 1, 2019

This supersedes #4597

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote tests
  • Updated relevant documentation (docs/)
  • Added a relevant changelog entry: clog add [section] [stanza] [message]
  • 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 marked this pull request as ready for review July 1, 2019 03:43
@alessio
Copy link
Contributor Author

alessio commented Jul 1, 2019

Will add a pending entry once review is passed

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

utACK

Copy link
Collaborator

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

Great refactor @alessio ! I don't think the handler should live on the keeper pkg, check the bank module structure you made last time for reference. Other than that this lgtm.

x/crisis/internal/keeper/handler.go Outdated Show resolved Hide resolved
x/crisis/module.go Outdated Show resolved Hide resolved
simapp/app.go Outdated Show resolved Hide resolved
x/crisis/internal/keeper/handler.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 1, 2019

Codecov Report

Merging #4649 into master will increase coverage by <.01%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           master    #4649      +/-   ##
==========================================
+ Coverage   54.97%   54.98%   +<.01%     
==========================================
  Files         272      271       -1     
  Lines       17027    17021       -6     
==========================================
- Hits         9361     9359       -2     
+ Misses       6980     6976       -4     
  Partials      686      686

Copy link
Collaborator

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

LGTM, pending clog only

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.

Looks great @alessio. Left some further feedback 👍

// FeeCollectorName returns the name of the FeeCollector module.
func (k Keeper) FeeCollectorName() string { return k.feeCollectorName }

func (k Keeper) SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) sdk.Error {
Copy link
Contributor

Choose a reason for hiding this comment

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

The only valid execution of this is to send from an account to k.FeeCollectorName() only. So I'm thinking we change this to:

func (k Keeper) SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, amt sdk.Coins) sdk.Error {
  return k.supplyKeeper.SendCoinsFromAccountToModule(ctx, senderAddr, k.feeCollectorName, amt)
}

func (k Keeper) InvCheckPeriod() uint { return k.invCheckPeriod }

// FeeCollectorName returns the name of the FeeCollector module.
func (k Keeper) FeeCollectorName() string { return k.feeCollectorName }
Copy link
Contributor

Choose a reason for hiding this comment

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

We may not even need this. See below.

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.

ACK

@alexanderbez alexanderbez merged commit f1b08b8 into master Jul 1, 2019
@alexanderbez alexanderbez deleted the alessio/crisis-internal-2 branch July 1, 2019 16:50
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