-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(client/v2): implement version filtering using annotation #20083
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
Changes from 3 commits
0db9775
e6afe93
c9ff5eb
855c455
b79cee4
7641af6
487db3b
e9e8564
1b97e17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -114,7 +114,7 @@ err := autoCliOpts.EnhanceRootCommand(rootCmd) | |||||||||
| ## Signing | ||||||||||
|
|
||||||||||
| `autocli` supports signing transactions with the keyring. | ||||||||||
| The [`cosmos.msg.v1.signer` protobuf annotation](https://github.com/cosmos/cosmos-sdk/blob/9dd34510e27376005e7e7ff3628eab9dbc8ad6dc/docs/build/building-modules/05-protobuf-annotations.md#L9) defines the signer field of the message. | ||||||||||
| The [`cosmos.msg.v1.signer` protobuf annotation](https://docs.cosmos.network/main/build/building-modules/protobuf-annotations) defines the signer field of the message. | ||||||||||
| This field is automatically filled when using the `--from` flag or defining the signer as a positional argument. | ||||||||||
|
|
||||||||||
| :::warning | ||||||||||
|
|
@@ -199,6 +199,19 @@ https://github.com/cosmos/cosmos-sdk/blob/fa4d87ef7e6d87aaccc94c337ffd2fe90fcb7a | |||||||||
|
|
||||||||||
| If not set to true, `AutoCLI` will not generate commands for the module if there are already commands registered for the module (when `GetTxCmd()` or `GetQueryCmd()` are defined). | ||||||||||
|
|
||||||||||
| ### Skip a command | ||||||||||
|
|
||||||||||
| AutoCLI automatically skips unsupported commands when [`cosmos_proto.method_added_in` protobuf annotation](https://docs.cosmos.network/main/build/building-modules/protobuf-annotations) is present. | ||||||||||
|
|
||||||||||
| Additionally, a command can be manually skipped using the `autocliv1.RpcCommandOptions`: | ||||||||||
|
|
||||||||||
| ```go | ||||||||||
| *autocliv1.RpcCommandOptions{ | ||||||||||
| RpcMethod: "Params", // The name of the gRPC service | ||||||||||
| Skip: true, | ||||||||||
| } | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ### Use AutoCLI for non module commands | ||||||||||
|
|
||||||||||
| It is possible to use `AutoCLI` for non module commands. The trick is still to implement the `appmodule.Module` interface and append it to the `appOptions.ModuleOptions` map. | ||||||||||
|
|
@@ -220,14 +233,16 @@ For more information on `hubl`, including how to configure a new chain and query | |||||||||
| # Off-Chain | ||||||||||
|
|
||||||||||
| Off-chain functionalities allow you to sign and verify files with two commands: | ||||||||||
| + `sign-file` for signing a file. | ||||||||||
| + `verify-file` for verifying a previously signed file. | ||||||||||
|
|
||||||||||
| * `sign-file` for signing a file. | ||||||||||
| * `verify-file` for verifying a previously signed file. | ||||||||||
|
Comment on lines
+237
to
+238
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure sentences start with an uppercase letter. - * `sign-file` for signing a file.
- * `verify-file` for verifying a previously signed file.
+ * `Sign-file` for signing a file.
+ * `Verify-file` for verifying a previously signed file.Committable suggestion
Suggested change
|
||||||||||
|
|
||||||||||
| Signing a file will result in a Tx with a `MsgSignArbitraryData` as described in the [Off-chain CIP](https://github.com/cosmos/cips/blob/main/cips/cip-X.md). | ||||||||||
|
|
||||||||||
| ## Sign a file | ||||||||||
|
|
||||||||||
| To sign a file `sign-file` command offers some helpful flags: | ||||||||||
|
|
||||||||||
| ```text | ||||||||||
| --encoding string Choose an encoding method for the file content to be added as msg data (no-encoding|base64|hex) (default "no-encoding") | ||||||||||
| --indent string Choose an indent for the tx (default " ") | ||||||||||
|
|
@@ -237,26 +252,32 @@ To sign a file `sign-file` command offers some helpful flags: | |||||||||
| ``` | ||||||||||
|
|
||||||||||
| The `encoding` flag lets you choose how the contents of the file should be encoded. For example: | ||||||||||
| + `simd off-chain sign-file alice myFile.json` | ||||||||||
| + ```json | ||||||||||
|
|
||||||||||
| * `simd off-chain sign-file alice myFile.json` | ||||||||||
|
|
||||||||||
| * ```json | ||||||||||
| { | ||||||||||
| "@type": "/offchain.MsgSignArbitraryData", | ||||||||||
| "appDomain": "simd", | ||||||||||
| "signer": "cosmos1x33fy6rusfprkntvjsfregss7rvsvyy4lkwrqu", | ||||||||||
| "data": "Hello World!\n" | ||||||||||
| } | ||||||||||
| ``` | ||||||||||
| + `simd off-chain sign-file alice myFile.json --encoding base64` | ||||||||||
| + ```json | ||||||||||
|
|
||||||||||
| * `simd off-chain sign-file alice myFile.json --encoding base64` | ||||||||||
|
|
||||||||||
| * ```json | ||||||||||
| { | ||||||||||
| "@type": "/offchain.MsgSignArbitraryData", | ||||||||||
| "appDomain": "simd", | ||||||||||
| "signer": "cosmos1x33fy6rusfprkntvjsfregss7rvsvyy4lkwrqu", | ||||||||||
| "data": "SGVsbG8gV29ybGQhCg==" | ||||||||||
| } | ||||||||||
| ``` | ||||||||||
| + `simd off-chain sign-file alice myFile.json --encoding hex` | ||||||||||
| + ```json | ||||||||||
|
|
||||||||||
| * `simd off-chain sign-file alice myFile.json --encoding hex` | ||||||||||
|
|
||||||||||
| * ```json | ||||||||||
| { | ||||||||||
| "@type": "/offchain.MsgSignArbitraryData", | ||||||||||
| "appDomain": "simd", | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,11 +33,6 @@ func (b *Builder) buildMethodCommandCommon(descriptor protoreflect.MethodDescrip | |
| short = fmt.Sprintf("Execute the %s RPC method", descriptor.Name()) | ||
| } | ||
|
|
||
| long := options.Long | ||
| if long == "" { | ||
| long = util.DescriptorDocs(descriptor) | ||
| } | ||
|
|
||
| inputDesc := descriptor.Input() | ||
| inputType := util.ResolveMessageType(b.TypeResolver, inputDesc) | ||
|
|
||
|
|
@@ -49,7 +44,7 @@ func (b *Builder) buildMethodCommandCommon(descriptor protoreflect.MethodDescrip | |
| cmd := &cobra.Command{ | ||
| SilenceUsage: false, | ||
| Use: use, | ||
| Long: long, | ||
| Long: options.Long, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification The search results indicate that the direct use of
Analysis chainDirect use of Scripts ExecutedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check for consistency of direct use of options fields in command setups across the project.
rg --type go 'Long: options.'
Length of output: 97 |
||
| Short: short, | ||
| Example: options.Example, | ||
| Aliases: options.Alias, | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.