-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
refactor(x/account): Enable AutoCLI for x/accounts #22727
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3b007ea
proto
DongLieu 85eca3c
updates wwith new type AccountQueryRequest
DongLieu ad433d4
updates TestQueryServer
DongLieu 2e94816
encode msg json to proto
DongLieu 32123da
autocli for querry accounts
DongLieu 5ead3d3
fix proto tx MsgInit
DongLieu f89848f
updates new type MsgInit
DongLieu 8640966
autocli for Init
DongLieu 3a202ca
proto MsgExecute
DongLieu 8f0ae9d
update Init: check map
DongLieu 8a4e0b6
updates with new MsgExecute
DongLieu 35fb3e8
updates test
DongLieu f1a888c
MsgExecute order updates
DongLieu a542644
autocli for Execute
DongLieu 168ff24
RegisterMsgHandlers has been registered
DongLieu 3b3ec1f
RegisterQueryHandlers has been registered
DongLieu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package accounts | ||
|
||
import ( | ||
accountsv1 "cosmossdk.io/api/cosmos/accounts/v1" | ||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" | ||
"fmt" | ||
|
||
"github.com/cosmos/cosmos-sdk/version" | ||
) | ||
|
||
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. | ||
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { | ||
return &autocliv1.ModuleOptions{ | ||
Query: &autocliv1.ServiceCommandDescriptor{ | ||
Service: accountsv1.Query_ServiceDesc.ServiceName, | ||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{ | ||
{ | ||
RpcMethod: "AccountQuery", | ||
Use: "query <account-address> <query-request-type-url> <json-message>", | ||
Short: "Query account state", | ||
Example: fmt.Sprintf(`%s q accounts query cosmos1uds6tz96dxfllz7tz3s3tm8tlg6x95g0mc2987sx6psjz98qlpss89sheu cosmos.accounts.defaults.multisig.v1.QueryProposal '{"proposal_id":1}`, version.AppName), | ||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{ | ||
{ProtoField: "target"}, | ||
{ProtoField: "query_request_type_url"}, | ||
{ProtoField: "json_message"}, | ||
}, | ||
}, | ||
}, | ||
EnhanceCustomCommand: true, | ||
}, | ||
Tx: &autocliv1.ServiceCommandDescriptor{ | ||
Service: accountsv1.Msg_ServiceDesc.ServiceName, | ||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{ | ||
{ | ||
RpcMethod: "Init", | ||
Use: "init <account-type> <json-message>", | ||
Short: "Initialize a new account", | ||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{ | ||
{ProtoField: "sender"}, | ||
{ProtoField: "account_type"}, | ||
{ProtoField: "json_message"}, | ||
{ProtoField: "funds", Varargs: true}, | ||
}, | ||
}, | ||
{ | ||
RpcMethod: "Execute", | ||
Use: "execute <account-address> <execute-msg-type-url> <json-message>", | ||
Short: "Execute state transition to account", | ||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{ | ||
{ProtoField: "sender"}, | ||
{ProtoField: "target"}, | ||
{ProtoField: "execute_msg_type_url"}, | ||
{ProtoField: "json_message"}, | ||
{ProtoField: "funds", Varargs: true}, | ||
}, | ||
}, | ||
}, | ||
EnhanceCustomCommand: true, | ||
}, | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🛠️ Refactor suggestion
Organize imports according to Go conventions
The import statements are not properly grouped and ordered. According to the Go coding conventions and the Uber Go Style Guide, imports should be grouped in the following order: standard library packages, third-party packages, and project-specific packages, each separated by a blank line.
Apply this diff to organize the imports:
📝 Committable suggestion
🧰 Tools
🪛 golangci-lint (1.62.2)
3-3: File is not
gci
-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order(gci)
6-6: File is not
gci
-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order(gci)