-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Conversation
86db427
to
85e381e
Compare
c054b94
to
928e60d
Compare
fix fix democoin fix tests pass lint last fix
Codecov Report
@@ 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. |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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
x/auth/mapper_test.go
Outdated
@@ -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{} }) |
There was a problem hiding this comment.
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
?
Sorry @mossid , this needs to be rebased or have develop merged back in and fixed |
b34dfa5
to
3bfe957
Compare
fix fix democoin fix tests pass lint last fix apply requests
There was a problem hiding this 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.
3bfe957
to
6c0b27f
Compare
6c0b27f
to
d0b64e6
Compare
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
d0b64e6
to
bc12880
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK
Closes: #673
Closes: #911