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

Account constructor in AccountMapper #1379

Merged
merged 2 commits into from
Jul 10, 2018
Merged

Conversation

mossid
Copy link
Contributor

@mossid mossid commented Jun 26, 2018

  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG.md
  • Updated Gaia/Examples
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Closes: #673
Closes: #911

@mossid mossid requested a review from ebuchman as a code owner June 26, 2018 02:46
@mossid mossid force-pushed the joon/673-am-constructor branch 4 times, most recently from 86db427 to 85e381e Compare June 26, 2018 04:46
@mossid mossid changed the title Constructor in AccountMapper instead of Prototype Account constructor in AccountMapper Jun 26, 2018
mossid added a commit that referenced this pull request Jun 26, 2018
fix

fix democoin

fix tests

pass lint

last fix
@codecov
Copy link

codecov bot commented Jun 26, 2018

Codecov Report

Merging #1379 into develop will increase coverage by 0.05%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #1379      +/-   ##
===========================================
+ Coverage    63.72%   63.78%   +0.05%     
===========================================
  Files          122      122              
  Lines         6776     6762      -14     
===========================================
- Hits          4318     4313       -5     
+ Misses        2211     2204       -7     
+ Partials       247      245       -2

@@ -142,30 +139,6 @@ func (am AccountMapper) GetNextAccountNumber(ctx sdk.Context) int64 {
//----------------------------------------
// misc.

// Creates a new struct (or pointer to struct) from am.proto.
Copy link
Member

Choose a reason for hiding this comment

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

was there some reason we didn't just do this initially ?

Is it worth introducing a type AccountConstructor func() Account ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems this could be used in the unit tests as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

type ProtoAccount func() Account looks better for me, I think word 'proto' fits with the context.

@ebuchman ebuchman mentioned this pull request Jun 28, 2018
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.

Changes LGTM 👍 just left one small remark

@@ -32,7 +32,7 @@ func TestAccountMapperGetSet(t *testing.T) {

// make context and mapper
ctx := sdk.NewContext(ms, abci.Header{}, false, log.NewNopLogger())
mapper := NewAccountMapper(cdc, capKey, &BaseAccount{})
mapper := NewAccountMapper(cdc, capKey, func() Account { return &BaseAccount{} })
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to update this to auth.ProtoBaseAccount?

@ebuchman
Copy link
Member

ebuchman commented Jul 3, 2018

Sorry @mossid , this needs to be rebased or have develop merged back in and fixed

@cwgoes cwgoes changed the base branch from develop to unstable July 3, 2018 21:12
@cwgoes cwgoes changed the base branch from unstable to develop July 4, 2018 19:26
mossid added a commit that referenced this pull request Jul 5, 2018
fix

fix democoin

fix tests

pass lint

last fix

apply requests
Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

LGTM - fails build though.

mossid added a commit that referenced this pull request Jul 9, 2018
fix

fix democoin

fix tests

pass lint

last fix

apply requests

fix build failing

fix docs
fix

fix democoin

fix tests

pass lint

last fix

apply requests

fix build failing

fix docs
Copy link
Contributor

@cwgoes cwgoes 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
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

Tested ACK

@cwgoes cwgoes merged commit 0a8c9f1 into develop Jul 10, 2018
@cwgoes cwgoes deleted the joon/673-am-constructor branch July 10, 2018 23:28
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