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: Write bank module specification, check spec/code consistency #2853

Merged
merged 17 commits into from
Nov 29, 2018

Conversation

cwgoes
Copy link
Contributor

@cwgoes cwgoes commented Nov 19, 2018

Closes #1277
Closes #2887

Also does a bit of minor cleanup in x/bank.

If you think anything else should be added to the spec, do comment!

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • 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)

@cwgoes cwgoes added T:Docs Changes and features related to documentation. spec wip labels Nov 19, 2018
@codecov
Copy link

codecov bot commented Nov 19, 2018

Codecov Report

Merging #2853 into develop will increase coverage by 0.57%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #2853      +/-   ##
===========================================
+ Coverage    56.29%   56.86%   +0.57%     
===========================================
  Files          120      120              
  Lines         8406     8298     -108     
===========================================
- Hits          4732     4719      -13     
+ Misses        3352     3261      -91     
+ Partials       322      318       -4

@cwgoes
Copy link
Contributor Author

cwgoes commented Nov 22, 2018

Discovered two issues so far:

@cwgoes cwgoes changed the title WIP: Write bank module specification, check spec/code consistency R4R: Write bank module specification, check spec/code consistency Nov 23, 2018

# Keeper

## Denom Metadata
Copy link
Member

Choose a reason for hiding this comment

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

Don't we still want this metadata store?

Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIU This is moreso a spec for what we want at launch, not a spec for the ideal #pre-ibc

Copy link
Member

@sunnya97 sunnya97 Nov 26, 2018

Choose a reason for hiding this comment

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

This should be done prelaunch.

  1. It makes the staking codebase much simpler (removing this Pool that's being constantly passed around)
  2. Any UI/block explorer will want this.
  3. Having the loose token supply accounted by staking module is absurd and causes all sorts of weird situations. Governance currently gets around this in a super super hacky way (creating a burn account where it sends coins in order to "burn them"). Now, the loose token supply known by staking doesn't reflect reality. Had a discussion with @jaekwon about this, he agreed it needs to be prelaunch.

Copy link
Contributor Author

@cwgoes cwgoes Nov 26, 2018

Choose a reason for hiding this comment

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

OK, agreed, I'll do that in this PR.

Never mind, @sunnya97 wants to do this! 🎉

@@ -0,0 +1,130 @@
## Keepers

The bank module provides three different exported keeper interfaces which can be passed to other modules which need to read or update account balances. Modules should use the least-permissive interface which provides the functionality they require.
Copy link
Member

Choose a reason for hiding this comment

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

Should the interfaces maybe go in the sdk (types) folder? And the structs go in the bank module?

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.

Spec looks great @cwgoes -- left some minor comments, but overall LGTM.

docs/spec/bank/keepers.md Show resolved Hide resolved
x/bank/msgs.go Show resolved Hide resolved
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.

Looks great!

@cwgoes cwgoes merged commit 98caf44 into develop Nov 29, 2018
@cwgoes cwgoes deleted the cwgoes/bank-spec-code-consistency branch November 29, 2018 21:57
mircea-c pushed a commit that referenced this pull request Dec 4, 2018
…istency

* Update PENDING.md

* New structure

* Start transactions section

* Remove MsgIssue

* Update keepers.md

* Add state.md

* Update keepers.md, discovered #2887

* Move inputOutputCoins to BaseKeeper

* Remove no-loner-applicable tests

* More spec updates

* Tiny cleanup

* Clarify storage rationale

* Warn the user

* Remove extra newline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec T:Docs Changes and features related to documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants