Skip to content

Commit

Permalink
feat(evidence): autocli query support (#16625)
Browse files Browse the repository at this point in the history
(cherry picked from commit cf842f9)

# Conflicts:
#	x/evidence/go.mod
#	x/evidence/go.sum
  • Loading branch information
julienrbrt authored and mergify[bot] committed Jun 20, 2023
1 parent b6102fb commit 2f2ad76
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 175 deletions.
6 changes: 5 additions & 1 deletion x/evidence/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Features

* (x/evidence) [14724](https://github.com/cosmos/cosmos-sdk/pull/14724) The `x/evidence` module is extracted to have a separate go.mod file which allows it be a standalone module.
* (x/evidence) [14724](https://github.com/cosmos/cosmos-sdk/pull/14724) The `x/evidence` module is extracted to have a separate go.mod file which allows it be a standalone module.
* (keeper) [#15420](https://github.com/cosmos/cosmos-sdk/pull/15420) Move `BeginBlocker` to the keeper folder & make HandleEquivocation private

### API Breaking Changes
Expand All @@ -36,3 +36,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (keeper) [#15825](https://github.com/cosmos/cosmos-sdk/pull/15825) Evidence constructor now requires an `address.Codec` (`import "cosmossdk.io/core/address"`)
* [#16336](https://github.com/cosmos/cosmos-sdk/pull/16336) Use collections for state management:
* Removed: keeper `SetEvidence`, `GetEvidence`, `IterateEvidences`, `GetAllEvidences`, `MustMarshalEvidence`, `MustUnmarshalEvidence`, `MarshalEvidence`, `UnmarshalEvidence`

### Client Breaking Changes

* [#16625](https://github.com/cosmos/cosmos-sdk/pull/16625) The `simd q evidence evidence` command supports only querying an evidence by hash. For querying all evidences, use `simd q evidence list` instad.
34 changes: 34 additions & 0 deletions x/evidence/autocli.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package evidence

import (
"fmt"

autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
evidencev1beta1 "cosmossdk.io/api/cosmos/evidence/v1beta1"

"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: evidencev1beta1.Query_ServiceDesc.ServiceName,
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Evidence",
Use: "evidence [hash]",
Short: "Query for evidence by hash",
Example: fmt.Sprintf("%s query evidence DF0C23E8634E480F84B9D5674A7CDC9816466DEC28A3358F73260F68D28D7660", version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "hash"}},
},
{
RpcMethod: "AllEvidence",
Use: "list",
Short: "Query all (paginated) submitted evidence",
Example: fmt.Sprintf("%s query evidence --page=2 --page-limit=50", version.AppName),
},
},
},
}
}
92 changes: 0 additions & 92 deletions x/evidence/client/cli/query.go

This file was deleted.

81 changes: 0 additions & 81 deletions x/evidence/client/cli/query_test.go

This file was deleted.

4 changes: 4 additions & 0 deletions x/evidence/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ require (
cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c
github.com/cometbft/cometbft v0.38.0-rc1
github.com/cosmos/cosmos-proto v1.0.0-beta.3
<<<<<<< HEAD
github.com/cosmos/cosmos-sdk v0.50.0-alpha.0.0.20230619222503-1fb9c870c960
=======
github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230620151856-3aab81f45d55
>>>>>>> cf842f94f (feat(evidence): autocli query support (#16625))
github.com/cosmos/gogoproto v1.4.10
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
Expand Down
5 changes: 5 additions & 0 deletions x/evidence/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,13 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0
github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U=
github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o=
github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I=
<<<<<<< HEAD
github.com/cosmos/cosmos-sdk v0.50.0-alpha.0.0.20230619222503-1fb9c870c960 h1:rxX4UEQ86FtJu3bwhg1zFt1aFWslGGxR/xZMRw5pcnU=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.0.0.20230619222503-1fb9c870c960/go.mod h1:OgwDscYm9sKK/X5WiBI0jeTR/WowOxtTCsR1fF3eb+E=
=======
github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230620151856-3aab81f45d55 h1:qEWSMjCeg+ChbOh9VEJbxg8qFa33DLuVUunROeD5l00=
github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230620151856-3aab81f45d55/go.mod h1:/HloC8xR6Kwtj5ieHSbje4B39aObp43aRp2V12UR+9c=
>>>>>>> cf842f94f (feat(evidence): autocli query support (#16625))
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
Expand Down
2 changes: 1 addition & 1 deletion x/evidence/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (a AppModuleBasic) GetTxCmd() *cobra.Command {

// GetQueryCmd returns the evidence module's root query command.
func (AppModuleBasic) GetQueryCmd() *cobra.Command {
return cli.GetQueryCmd()
return nil
}

// RegisterInterfaces registers the evidence module's interface types
Expand Down

0 comments on commit 2f2ad76

Please sign in to comment.