-
Notifications
You must be signed in to change notification settings - Fork 13
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
[Morse->Shannon Migration] scaffold: MorseAccountState
single
#1045
base: chore/migration/state-prep
Are you sure you want to change the base?
[Morse->Shannon Migration] scaffold: MorseAccountState
single
#1045
Conversation
89b83f7
to
b720680
Compare
b720680
to
cf4a0c5
Compare
|
||
} | ||
|
||
// Queries a MorseAccountState by index. |
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.
- It is not clear to be what/where/why this index is
- #PUC if this returns the entire MorseAccountState that was uploaded.
} | ||
|
||
message QueryGetMorseAccountStateRequest {} |
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.
#PUC here and below
message MsgUpdateParamsResponse {} | ||
|
||
message MsgCreateMorseAccountState { |
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.
Reminder to add comments everywhere.
It's fine if it's AI generated assuming you review/update after.
Keep it concise but clear.
message MsgCreateMorseAccountStateResponse { | ||
bytes state_hash = 1 [(gogoproto.jsontag) = "state_hash"]; | ||
uint64 num_accounts = 2 [(gogoproto.jsontag) = "num_accounts"]; |
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.
Not clear what kind of accounts these are.
- Nodes/Suppliers?
- Applications?
- Validators?
- Just token holders?
Consider adding TODOs if we're going to expand it
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.
Will #PUC, but I've been extremely consistent in my phrasing, which I've been careful to keep consitent with tendermint/comet/cosmos conventions. Account only refers to one on-chain concept, which encapsulates a token balance and a public key. While the concrete representation differs from tendermint to cosmos (and cosmos further isolates balance from public keys internally), this conceptualization is sufficient and consistent, in my view.
} | ||
|
||
message MsgCreateMorseAccountStateResponse { |
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.
#PUC
"github.com/pokt-network/poktroll/x/migration/types" | ||
) | ||
|
||
func (k Keeper) MorseAccountState(goCtx context.Context, req *types.QueryGetMorseAccountStateRequest) (*types.QueryGetMorseAccountStateResponse, error) { |
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.
Consider adding a req.ValidateBasic()
like we do in other parts of the code.
|
||
val, found := k.GetMorseAccountState(ctx) | ||
if !found { | ||
return nil, status.Error(codes.NotFound, "not found") |
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.
Can we do some logging here as well?
@@ -0,0 +1,48 @@ | |||
package keeper_test |
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.
NOTE: I'm skiping reviewing unit tests in leu of time.
} | ||
} | ||
|
||
func (msg *MsgCreateMorseAccountState) ValidateBasic() error { |
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 not need to validate morseAccountState?
message QueryGetMorseAccountStateRequest {} | ||
|
||
message QueryGetMorseAccountStateResponse { |
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.
E2E test for this? Doesn't have to be in this PR.
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.
We have unit/integration coverage over this.
Summary
Scaffolds the on-chain
MorseAccountState
single as well as a create message/query handlers. Supersedes #1035.Changes:
Issue
Type of change
Select one or more from the following:
consensus-breaking
label if so. See [Infra] Automatically add theconsensus-breaking
label #791 for detailsSanity Checklist
assignees
,reviewers
,labels
,project
,iteration
andmilestone
make docusaurus_start
make go_develop_and_test
andmake test_e2e
devnet-test-e2e
label to run E2E tests in CI