Skip to content

Commit

Permalink
QueryOldestUnconfirmVsc -> QueryOldestUnconfirmedVsc
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoke committed Apr 2, 2024
1 parent 643c87c commit 1d136f1
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 187 deletions.
10 changes: 5 additions & 5 deletions proto/interchain_security/ccv/provider/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ service Query {
"/interchain_security/ccv/provider/params";
}

// QueryOldestUnconfirmVsc returns the send timestamp of the oldest unconfirmed VSCPacket for a given chainID
rpc QueryOldestUnconfirmVsc(QueryOldestUnconfirmVscRequest)
returns (QueryOldestUnconfirmVscResponse) {
// QueryOldestUnconfirmedVsc returns the send timestamp of the oldest unconfirmed VSCPacket for a given chainID
rpc QueryOldestUnconfirmedVsc(QueryOldestUnconfirmedVscRequest)
returns (QueryOldestUnconfirmedVscResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/oldest_unconfirmed_vsc/{chain_id}";
}
Expand Down Expand Up @@ -219,9 +219,9 @@ message QueryParamsResponse {
Params params = 1 [(gogoproto.nullable) = false];
}

message QueryOldestUnconfirmVscRequest { string chain_id = 1; }
message QueryOldestUnconfirmedVscRequest { string chain_id = 1; }

message QueryOldestUnconfirmVscResponse {
message QueryOldestUnconfirmedVscResponse {
interchain_security.ccv.provider.v1.VscSendTimestamp vsc_send_timestamp = 1
[ (gogoproto.nullable) = false ];
}
8 changes: 4 additions & 4 deletions x/ccv/provider/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewQueryCmd() *cobra.Command {
cmd.AddCommand(CmdProposedConsumerChains())
cmd.AddCommand(CmdAllPairsValConAddrByConsumerChainID())
cmd.AddCommand(CmdProviderParameters())
cmd.AddCommand(CmdOldestUnconfirmVsc())
cmd.AddCommand(CmdOldestUnconfirmedVsc())
return cmd
}

Expand Down Expand Up @@ -412,7 +412,7 @@ $ %s query provider params

}

func CmdOldestUnconfirmVsc() *cobra.Command {
func CmdOldestUnconfirmedVsc() *cobra.Command {
cmd := &cobra.Command{
Use: "oldest_unconfirmed_vsc [chainid]",
Short: "Query the send timestamp of the oldest unconfirmed VSCPacket by chain id",
Expand All @@ -424,8 +424,8 @@ func CmdOldestUnconfirmVsc() *cobra.Command {
}
queryClient := types.NewQueryClient(clientCtx)

req := types.QueryOldestUnconfirmVscRequest{ChainId: args[0]}
res, err := queryClient.QueryOldestUnconfirmVsc(cmd.Context(), &req)
req := types.QueryOldestUnconfirmedVscRequest{ChainId: args[0]}
res, err := queryClient.QueryOldestUnconfirmedVsc(cmd.Context(), &req)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions x/ccv/provider/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (k Keeper) QueryParams(c context.Context, _ *types.QueryParamsRequest) (*ty
return &types.QueryParamsResponse{Params: params}, nil
}

func (k Keeper) QueryOldestUnconfirmVsc(goCtx context.Context, req *types.QueryOldestUnconfirmVscRequest) (*types.QueryOldestUnconfirmVscResponse, error) {
func (k Keeper) QueryOldestUnconfirmedVsc(goCtx context.Context, req *types.QueryOldestUnconfirmedVscRequest) (*types.QueryOldestUnconfirmedVscResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

if req == nil {
Expand Down Expand Up @@ -253,5 +253,5 @@ func (k Keeper) QueryOldestUnconfirmVsc(goCtx context.Context, req *types.QueryO
)
}

return &types.QueryOldestUnconfirmVscResponse{VscSendTimestamp: ts}, nil
return &types.QueryOldestUnconfirmedVscResponse{VscSendTimestamp: ts}, nil
}
10 changes: 5 additions & 5 deletions x/ccv/provider/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestQueryAllPairsValConAddrByConsumerChainID(t *testing.T) {
require.Equal(t, &expectedResult, response.PairValConAddr[0])
}

func TestQueryOldestUnconfirmVsc(t *testing.T) {
func TestQueryOldestUnconfirmedVsc(t *testing.T) {
chainID := consumer

pk, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t))
Expand All @@ -68,19 +68,19 @@ func TestQueryOldestUnconfirmVsc(t *testing.T) {
pk.SetConsumerClientId(ctx, chainID, "client-1")

// Request is nil
_, err := pk.QueryOldestUnconfirmVsc(ctx, nil)
_, err := pk.QueryOldestUnconfirmedVsc(ctx, nil)
require.Error(t, err)

// Request with chainId is empty
_, err = pk.QueryOldestUnconfirmVsc(ctx, &types.QueryOldestUnconfirmVscRequest{})
_, err = pk.QueryOldestUnconfirmedVsc(ctx, &types.QueryOldestUnconfirmedVscRequest{})
require.Error(t, err)

// Request with chainId is invalid
_, err = pk.QueryOldestUnconfirmVsc(ctx, &types.QueryOldestUnconfirmVscRequest{ChainId: "invalidChainId"})
_, err = pk.QueryOldestUnconfirmedVsc(ctx, &types.QueryOldestUnconfirmedVscRequest{ChainId: "invalidChainId"})
require.Error(t, err)

// Request is valid
response, err := pk.QueryOldestUnconfirmVsc(ctx, &types.QueryOldestUnconfirmVscRequest{ChainId: chainID})
response, err := pk.QueryOldestUnconfirmedVsc(ctx, &types.QueryOldestUnconfirmedVscRequest{ChainId: chainID})
require.NoError(t, err)
expectedResult := types.VscSendTimestamp{
VscId: vscID,
Expand Down
Loading

0 comments on commit 1d136f1

Please sign in to comment.