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

R4R: x/bank: Keeper Intefaces #2146

Merged
merged 6 commits into from
Sep 10, 2018
Merged

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Aug 24, 2018

closes: #2145


  • 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.

  • 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)

@alexanderbez alexanderbez changed the title x/bank: Keeper Intefaces WIP: x/bank: Keeper Intefaces Aug 24, 2018
@codecov
Copy link

codecov bot commented Aug 24, 2018

Codecov Report

Merging #2146 into develop will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff            @@
##           develop    #2146   +/-   ##
========================================
  Coverage    63.91%   63.91%           
========================================
  Files          134      134           
  Lines         8194     8194           
========================================
  Hits          5237     5237           
  Misses        2604     2604           
  Partials       353      353

@alexanderbez
Copy link
Contributor Author

Going to close this until we get more architecture and design discussions on how we want to handle banking and IBC in ethermint.

@alexanderbez
Copy link
Contributor Author

After today's discussion, we believe this is a valid approach to use in Ethermint where we'd have another abstraction atop of the interface implementation to only allow a single predetermined coin.

/cc @jaekwon @ebuchman

@alexanderbez alexanderbez reopened this Aug 28, 2018
@alexanderbez alexanderbez changed the title WIP: x/bank: Keeper Intefaces R4R: x/bank: Keeper Intefaces Aug 28, 2018
@alexanderbez alexanderbez removed the request for review from zramsay August 28, 2018 16:19
x/bank/keeper.go Outdated
// Keeper defines a module interface that facilitates the transfer of coins
// between accounts.
type Keeper interface {
GetCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we define Keeper as

type Keeper interface {
  SendKeeper
  ViewKeeper
  SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Tags, sdk.Error)
  AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Tags, sdk.Error)
}

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed we can! This was a quick job :-p

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@codecov
Copy link

codecov bot commented Aug 29, 2018

Codecov Report

Merging #2146 into develop will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff            @@
##           develop    #2146   +/-   ##
========================================
  Coverage    63.87%   63.87%           
========================================
  Files          140      140           
  Lines         8682     8682           
========================================
  Hits          5546     5546           
  Misses        2756     2756           
  Partials       380      380

Copy link
Contributor

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

LGTM! Great idea :)

@rigelrozanski
Copy link
Contributor

lint fail

@alexanderbez
Copy link
Contributor Author

This lint bug seems to have crept its way into develop. There is a fix on: https://github.com/cosmos/cosmos-sdk/pull/2216/files#diff-b67911656ef5d18c4ae36cb6741b7965

Should we just open a separate PR for this?

@alexanderbez
Copy link
Contributor Author

Never mind, fixed in #2257. Merging develop.

@alexanderbez
Copy link
Contributor Author

@rigelrozanski fixed :-)

@alexanderbez
Copy link
Contributor Author

Blocked on fixing non-determinism in develop due to gov BFT time introduction.

@ValarDragon
Copy link
Contributor

ValarDragon commented Sep 8, 2018

Looks like this now just needs the merge conflicts to be fixed

(Sorry my PR edited the exact same set of lines as this one)

@alexanderbez
Copy link
Contributor Author

@ValarDragon no worries 😃

@alexanderbez
Copy link
Contributor Author

Team,

Updated + resolved 👍

@rigelrozanski rigelrozanski merged commit e13cdc0 into develop Sep 10, 2018
@rigelrozanski rigelrozanski deleted the bez/2145-bank-keeper-interface branch September 10, 2018 18:25
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.

x/bank: Implement Interfaces
5 participants