Skip to content

Commit

Permalink
took into account comments
Browse files Browse the repository at this point in the history
  • Loading branch information
insumity committed Aug 28, 2024
1 parent 2fd5205 commit 7591a53
Show file tree
Hide file tree
Showing 13 changed files with 278 additions and 1,592 deletions.
8 changes: 4 additions & 4 deletions proto/interchain_security/ccv/provider/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ message GenesisState {
// empty for a new chain
repeated ValsetUpdateIdToHeight valset_update_id_to_height = 5
[ (gogoproto.nullable) = false ];
// empty for a new chain
// [DEPRECATED] empty for a new chain
repeated ConsumerAdditionProposal consumer_addition_proposals = 6
[ (gogoproto.nullable) = false ];
// empty for a new chain
[ deprecated = true, (gogoproto.nullable) = false ];
// [DEPRECATED] empty for a new chain
repeated ConsumerRemovalProposal consumer_removal_proposals = 7
[ (gogoproto.nullable) = false ];
[ deprecated = true, (gogoproto.nullable) = false ];
Params params = 8 [ (gogoproto.nullable) = false ];
// empty for a new chain
repeated ValidatorConsumerPubKey validator_consumer_pubkeys = 9
Expand Down
45 changes: 7 additions & 38 deletions proto/interchain_security/ccv/provider/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,20 @@ service Query {
"/interchain_security/ccv/provider/consumer_chains";
}

// [DEPRECATED]: Use `QueryConsumersThatAreAboutToStart` instead
// QueryConsumerChainStarts queries consumer chain start proposals.
rpc QueryConsumerChainStarts(QueryConsumerChainStartProposalsRequest)
returns (QueryConsumerChainStartProposalsResponse) {
option deprecated = true;
option (google.api.http).get =
"/interchain_security/ccv/provider/consumer_chain_start_proposals";
}

rpc QueryConsumersThatAreAboutToStart(QueryConsumersThatAreAboutToStartRequest)
returns (QueryConsumersThatAreAboutToStartResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/consumers_that_are_about_to_start";
}

// [DEPRECATED]: Use `QueryConsumersThatAreAboutToStop` instead
// QueryConsumerChainStops queries consumer chain stop proposals.
rpc QueryConsumerChainStops(QueryConsumerChainStopProposalsRequest)
returns (QueryConsumerChainStopProposalsResponse) {
option deprecated = true;
option (google.api.http).get =
"/interchain_security/ccv/provider/consumer_chain_stop_proposals";
}

rpc QueryConsumersThatAreAboutToStop(QueryConsumersThatAreAboutToStopRequest)
returns (QueryConsumersThatAreAboutToStopResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/consumers_that_are_about_to_stop";
}

// QueryValidatorConsumerAddr queries the address
// assigned by a validator for a consumer chain.
rpc QueryValidatorConsumerAddr(QueryValidatorConsumerAddrRequest)
Expand Down Expand Up @@ -98,11 +82,12 @@ service Query {
"/interchain_security/ccv/provider/registered_consumer_reward_denoms";
}

// QueryProposedConsumerChainIDs returns the chain IDs of the proposed consumer chain addition proposals
// [DEPRECATED] QueryProposedConsumerChainIDs returns the chain IDs of the proposed consumer chain addition proposals
// that are still in the voting period
rpc QueryProposedConsumerChainIDs(
QueryProposedChainIDsRequest)
returns (QueryProposedChainIDsResponse) {
option deprecated = true;
option (google.api.http).get =
"/interchain_security/ccv/provider/proposed_consumer_chains";
}
Expand Down Expand Up @@ -211,35 +196,18 @@ message QueryConsumerChainsRequest {}

message QueryConsumerChainsResponse { repeated Chain chains = 1; }

// [DEPRECATED] use `QueryConsumersThatAreAboutToStartRequest` instead
message QueryConsumerChainStartProposalsRequest {}

// [DEPRECATED] use `QueryConsumersThatAreAboutToStartResponse` instead
message QueryConsumerChainStartProposalsResponse {
ConsumerAdditionProposals proposals = 1 [deprecated = true];
}

message QueryConsumersThatAreAboutToStartRequest {}

message QueryConsumersThatAreAboutToStartResponse {
repeated string consumer_ids = 1;
}

// [DEPRECATED] use `QueryConsumersThatAreAboutToStopRequest` instead
message QueryConsumerChainStopProposalsRequest {}

// [DEPRECATED] use `QueryConsumersThatAreAboutToStopResponse` instead
message QueryConsumerChainStopProposalsResponse {
ConsumerRemovalProposals proposals = 1 [deprecated = true];
}

message QueryConsumersThatAreAboutToStopRequest {}

message QueryConsumersThatAreAboutToStopResponse {
repeated string consumer_ids = 1;
}


message Chain {
string chain_id = 1;
string client_id = 2;
Expand Down Expand Up @@ -312,18 +280,19 @@ message QueryRegisteredConsumerRewardDenomsResponse {
repeated string denoms = 1;
}

// [DEPRECATED]: request used in query that is not currently supported
message QueryProposedChainIDsRequest {}

// [DEPRECATED]: response used in query that is not currently supported
message QueryProposedChainIDsResponse {
repeated ProposedChain proposedChains = 1
[ (gogoproto.nullable) = false ];
[ deprecated = true, (gogoproto.nullable) = false ];
}

message ProposedChain {
// [DEPRECATED] use `consumer_id` instead
string chainID = 1 [deprecated = true];
uint64 proposalID = 2;
string consumer_id = 3;
uint64 proposalID = 2 [deprecated = true];
string consumer_id = 3 [deprecated = true];
}

message QueryAllPairsValConAddrByConsumerChainIDRequest {
Expand Down
127 changes: 0 additions & 127 deletions tests/integration/provider_gov_hooks.go

This file was deleted.

60 changes: 2 additions & 58 deletions x/ccv/provider/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ func NewQueryCmd() *cobra.Command {
cmd.AddCommand(CmdConsumerGenesis())
cmd.AddCommand(CmdConsumerChains())
cmd.AddCommand(CmdConsumerStartProposals())
cmd.AddCommand(CmdListConsumersThatAreAboutToStart())
cmd.AddCommand(CmdConsumerStopProposals())
cmd.AddCommand(CmdListConsumersThatAreAboutToStop())
cmd.AddCommand(CmdConsumerValidatorKeyAssignment())
cmd.AddCommand(CmdProviderValidatorKey())
cmd.AddCommand(CmdThrottleState())
Expand Down Expand Up @@ -134,7 +132,7 @@ func CmdProposedConsumerChains() *cobra.Command {
func CmdConsumerStartProposals() *cobra.Command {
cmd := &cobra.Command{
Use: "list-start-proposals",
Short: "DEPRECATED! Use `list-consumers-that-will-start` instead.",
Short: "DEPRECATED! Do not use.",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx, err := client.GetClientQueryContext(cmd)
Expand All @@ -158,37 +156,10 @@ func CmdConsumerStartProposals() *cobra.Command {
return cmd
}

func CmdListConsumersThatAreAboutToStart() *cobra.Command {
cmd := &cobra.Command{
Use: "list-consumers-that-will-start",
Short: "Query all the consumer chains that are initialized and about to start.",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)

req := &types.QueryConsumersThatAreAboutToStartRequest{}
res, err := queryClient.QueryConsumersThatAreAboutToStart(cmd.Context(), req)
if err != nil {
return err
}

return clientCtx.PrintProto(res)
},
}

flags.AddQueryFlagsToCmd(cmd)

return cmd
}

func CmdConsumerStopProposals() *cobra.Command {
cmd := &cobra.Command{
Use: "list-stop-proposals",
Short: "DEPRECATED! Use `list-consumers-that-will-stop` instead.",
Short: "DEPRECATED! Do not use.",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx, err := client.GetClientQueryContext(cmd)
Expand All @@ -212,33 +183,6 @@ func CmdConsumerStopProposals() *cobra.Command {
return cmd
}

func CmdListConsumersThatAreAboutToStop() *cobra.Command {
cmd := &cobra.Command{
Use: "list-consumers-that-will-stop",
Short: "Query all the consumer chains that are launched and about to stop.",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)

req := &types.QueryConsumersThatAreAboutToStopRequest{}
res, err := queryClient.QueryConsumersThatAreAboutToStop(cmd.Context(), req)
if err != nil {
return err
}

return clientCtx.PrintProto(res)
},
}

flags.AddQueryFlagsToCmd(cmd)

return cmd
}

// TODO: fix naming
func CmdConsumerValidatorKeyAssignment() *cobra.Command {
bech32PrefixConsAddr := sdk.GetConfig().GetBech32ConsensusAddrPrefix()
Expand Down
Loading

0 comments on commit 7591a53

Please sign in to comment.