-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(upgrade): autocli query support (#16903)
- Loading branch information
1 parent
8003261
commit 320eea1
Showing
17 changed files
with
74 additions
and
500 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
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
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
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
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,53 @@ | ||
package upgrade | ||
|
||
import ( | ||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" | ||
upgradev1beta1 "cosmossdk.io/api/cosmos/upgrade/v1beta1" | ||
) | ||
|
||
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { | ||
return &autocliv1.ModuleOptions{ | ||
Query: &autocliv1.ServiceCommandDescriptor{ | ||
Service: upgradev1beta1.Query_ServiceDesc.ServiceName, | ||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{ | ||
{ | ||
RpcMethod: "CurrentPlan", | ||
Use: "plan", | ||
Short: "Query the upgrade plan (if one exists)", | ||
Long: "Gets the currently scheduled upgrade plan, if one exists", | ||
}, | ||
{ | ||
RpcMethod: "AppliedPlan", | ||
Use: "applied [upgrade-name]", | ||
Short: "Query the block header for height at which a completed upgrade was applied", | ||
Long: "If upgrade-name was previously executed on the chain, this returns the header for the block at which it was applied. This helps a client determine which binary was valid over a given range of blocks, as well as more context to understand past migrations.", | ||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{ | ||
{ProtoField: "name"}, | ||
}, | ||
}, | ||
{ | ||
RpcMethod: "ModuleVersions", | ||
Use: "module-versions [optional module_name]", | ||
Alias: []string{"module_versions"}, | ||
Short: "Query the list of module versions", | ||
Long: "Gets a list of module names and their respective consensus versions. Following the command with a specific module name will return only that module's information.", | ||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{ | ||
{ProtoField: "module_name", Optional: true}, | ||
}, | ||
}, | ||
{ | ||
RpcMethod: "Authority", | ||
Use: "authority", | ||
Short: "Get the upgrade authority address", | ||
}, | ||
{ | ||
RpcMethod: "UpgradedConsensusState", | ||
Skip: true, // Skipping this command as the query is deprecated. | ||
}, | ||
}, | ||
}, | ||
Tx: &autocliv1.ServiceCommandDescriptor{ | ||
Service: upgradev1beta1.Query_ServiceDesc.ServiceName, | ||
}, | ||
} | ||
} |
Oops, something went wrong.