Skip to content
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

[CORE-824] Implement keeper methods for LimitParams and DenomCapacity #877

Merged
merged 5 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 51 additions & 51 deletions indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,29 @@ import * as _45 from "./feetiers/genesis";
import * as _46 from "./feetiers/params";
import * as _47 from "./feetiers/query";
import * as _48 from "./feetiers/tx";
import * as _49 from "./ibcratelimit/capacity";
import * as _50 from "./ibcratelimit/genesis";
import * as _51 from "./ibcratelimit/limit_params";
import * as _52 from "./ibcratelimit/query";
import * as _53 from "./ibcratelimit/tx";
import * as _54 from "./indexer/events/events";
import * as _55 from "./indexer/indexer_manager/event";
import * as _56 from "./indexer/off_chain_updates/off_chain_updates";
import * as _57 from "./indexer/protocol/v1/clob";
import * as _58 from "./indexer/protocol/v1/subaccount";
import * as _59 from "./indexer/redis/redis_order";
import * as _60 from "./indexer/shared/removal_reason";
import * as _61 from "./indexer/socks/messages";
import * as _62 from "./perpetuals/genesis";
import * as _63 from "./perpetuals/params";
import * as _64 from "./perpetuals/perpetual";
import * as _65 from "./perpetuals/query";
import * as _66 from "./perpetuals/tx";
import * as _67 from "./prices/genesis";
import * as _68 from "./prices/market_param";
import * as _69 from "./prices/market_price";
import * as _70 from "./prices/query";
import * as _71 from "./prices/tx";
import * as _49 from "./indexer/events/events";
import * as _50 from "./indexer/indexer_manager/event";
import * as _51 from "./indexer/off_chain_updates/off_chain_updates";
import * as _52 from "./indexer/protocol/v1/clob";
import * as _53 from "./indexer/protocol/v1/subaccount";
import * as _54 from "./indexer/redis/redis_order";
import * as _55 from "./indexer/shared/removal_reason";
import * as _56 from "./indexer/socks/messages";
import * as _57 from "./perpetuals/genesis";
import * as _58 from "./perpetuals/params";
import * as _59 from "./perpetuals/perpetual";
import * as _60 from "./perpetuals/query";
import * as _61 from "./perpetuals/tx";
import * as _62 from "./prices/genesis";
import * as _63 from "./prices/market_param";
import * as _64 from "./prices/market_price";
import * as _65 from "./prices/query";
import * as _66 from "./prices/tx";
import * as _67 from "./ratelimit/capacity";
import * as _68 from "./ratelimit/genesis";
import * as _69 from "./ratelimit/limit_params";
import * as _70 from "./ratelimit/query";
import * as _71 from "./ratelimit/tx";
import * as _72 from "./rewards/genesis";
import * as _73 from "./rewards/params";
import * as _74 from "./rewards/query";
Expand Down Expand Up @@ -95,9 +95,9 @@ import * as _105 from "./clob/query.lcd";
import * as _106 from "./delaymsg/query.lcd";
import * as _107 from "./epochs/query.lcd";
import * as _108 from "./feetiers/query.lcd";
import * as _109 from "./ibcratelimit/query.lcd";
import * as _110 from "./perpetuals/query.lcd";
import * as _111 from "./prices/query.lcd";
import * as _109 from "./perpetuals/query.lcd";
import * as _110 from "./prices/query.lcd";
import * as _111 from "./ratelimit/query.lcd";
import * as _112 from "./rewards/query.lcd";
import * as _113 from "./stats/query.lcd";
import * as _114 from "./subaccounts/query.lcd";
Expand All @@ -109,9 +109,9 @@ import * as _119 from "./clob/query.rpc.Query";
import * as _120 from "./delaymsg/query.rpc.Query";
import * as _121 from "./epochs/query.rpc.Query";
import * as _122 from "./feetiers/query.rpc.Query";
import * as _123 from "./ibcratelimit/query.rpc.Query";
import * as _124 from "./perpetuals/query.rpc.Query";
import * as _125 from "./prices/query.rpc.Query";
import * as _123 from "./perpetuals/query.rpc.Query";
import * as _124 from "./prices/query.rpc.Query";
import * as _125 from "./ratelimit/query.rpc.Query";
import * as _126 from "./rewards/query.rpc.Query";
import * as _127 from "./sending/query.rpc.Query";
import * as _128 from "./stats/query.rpc.Query";
Expand All @@ -122,9 +122,9 @@ import * as _132 from "./bridge/tx.rpc.msg";
import * as _133 from "./clob/tx.rpc.msg";
import * as _134 from "./delaymsg/tx.rpc.msg";
import * as _135 from "./feetiers/tx.rpc.msg";
import * as _136 from "./ibcratelimit/tx.rpc.msg";
import * as _137 from "./perpetuals/tx.rpc.msg";
import * as _138 from "./prices/tx.rpc.msg";
import * as _136 from "./perpetuals/tx.rpc.msg";
import * as _137 from "./prices/tx.rpc.msg";
import * as _138 from "./ratelimit/tx.rpc.msg";
import * as _139 from "./rewards/tx.rpc.msg";
import * as _140 from "./sending/tx.rpc.msg";
import * as _141 from "./stats/tx.rpc.msg";
Expand Down Expand Up @@ -208,35 +208,35 @@ export namespace dydxprotocol {
..._122,
..._135
};
export const ibcratelimit = { ..._49,
..._50,
..._51,
..._52,
..._53,
..._109,
..._123,
..._136
};
export namespace indexer {
export const events = { ..._54
export const events = { ..._49
};
export const indexer_manager = { ..._55
export const indexer_manager = { ..._50
};
export const off_chain_updates = { ..._56
export const off_chain_updates = { ..._51
};
export namespace protocol {
export const v1 = { ..._57,
..._58
export const v1 = { ..._52,
..._53
};
}
export const redis = { ..._59
export const redis = { ..._54
};
export const shared = { ..._60
export const shared = { ..._55
};
export const socks = { ..._61
export const socks = { ..._56
};
}
export const perpetuals = { ..._62,
export const perpetuals = { ..._57,
..._58,
..._59,
..._60,
..._61,
..._109,
..._123,
..._136
};
export const prices = { ..._62,
..._63,
..._64,
..._65,
Expand All @@ -245,7 +245,7 @@ export namespace dydxprotocol {
..._124,
..._137
};
export const prices = { ..._67,
export const ratelimit = { ..._67,
..._68,
..._69,
..._70,
Expand Down
6 changes: 3 additions & 3 deletions indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ export const createLCDClient = async ({
feetiers: new (await import("./feetiers/query.lcd")).LCDQueryClient({
requestClient
}),
ibcratelimit: new (await import("./ibcratelimit/query.lcd")).LCDQueryClient({
requestClient
}),
perpetuals: new (await import("./perpetuals/query.lcd")).LCDQueryClient({
requestClient
}),
prices: new (await import("./prices/query.lcd")).LCDQueryClient({
requestClient
}),
ratelimit: new (await import("./ratelimit/query.lcd")).LCDQueryClient({
requestClient
}),
rewards: new (await import("./rewards/query.lcd")).LCDQueryClient({
requestClient
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { LimitParams, LimitParamsSDKType } from "./limit_params";
import * as _m0 from "protobufjs/minimal";
import { DeepPartial } from "../../helpers";
/** GenesisState defines the ibcratelimit module's genesis state. */
/** GenesisState defines the ratelimit module's genesis state. */

export interface GenesisState {
/** limit_params_list defines the list of `LimitParams` at genesis. */
limitParamsList: LimitParams[];
}
/** GenesisState defines the ibcratelimit module's genesis state. */
/** GenesisState defines the ratelimit module's genesis state. */

export interface GenesisStateSDKType {
/** limit_params_list defines the list of `LimitParams` at genesis. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class LCDQueryClient {


async listLimitParams(_params: ListLimitParamsRequest = {}): Promise<ListLimitParamsResponseSDKType> {
const endpoint = `dydxprotocol/v4/ibcratelimit/list_limit_params`;
const endpoint = `dydxprotocol/v4/ratelimit/list_limit_params`;
return await this.req.get<ListLimitParamsResponseSDKType>(endpoint);
}
/* Query capacity by denom. */
Expand All @@ -31,7 +31,7 @@ export class LCDQueryClient {
options.params.denom = params.denom;
}

const endpoint = `dydxprotocol/v4/ibcratelimit/capacity_by_denom`;
const endpoint = `dydxprotocol/v4/ratelimit/capacity_by_denom`;
return await this.req.get<QueryCapacityByDenomResponseSDKType>(endpoint, options);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ export class QueryClientImpl implements Query {

listLimitParams(request: ListLimitParamsRequest = {}): Promise<ListLimitParamsResponse> {
const data = ListLimitParamsRequest.encode(request).finish();
const promise = this.rpc.request("dydxprotocol.ibcratelimit.Query", "ListLimitParams", data);
const promise = this.rpc.request("dydxprotocol.ratelimit.Query", "ListLimitParams", data);
return promise.then(data => ListLimitParamsResponse.decode(new _m0.Reader(data)));
}

capacityByDenom(request: QueryCapacityByDenomRequest): Promise<QueryCapacityByDenomResponse> {
const data = QueryCapacityByDenomRequest.encode(request).finish();
const promise = this.rpc.request("dydxprotocol.ibcratelimit.Query", "CapacityByDenom", data);
const promise = this.rpc.request("dydxprotocol.ratelimit.Query", "CapacityByDenom", data);
return promise.then(data => QueryCapacityByDenomResponse.decode(new _m0.Reader(data)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ export class MsgClientImpl implements Msg {

setLimitParams(request: MsgSetLimitParams): Promise<MsgSetLimitParamsResponse> {
const data = MsgSetLimitParams.encode(request).finish();
const promise = this.rpc.request("dydxprotocol.ibcratelimit.Msg", "SetLimitParams", data);
const promise = this.rpc.request("dydxprotocol.ratelimit.Msg", "SetLimitParams", data);
return promise.then(data => MsgSetLimitParamsResponse.decode(new _m0.Reader(data)));
}

deleteLimitParams(request: MsgDeleteLimitParams): Promise<MsgDeleteLimitParamsResponse> {
const data = MsgDeleteLimitParams.encode(request).finish();
const promise = this.rpc.request("dydxprotocol.ibcratelimit.Msg", "DeleteLimitParams", data);
const promise = this.rpc.request("dydxprotocol.ratelimit.Msg", "DeleteLimitParams", data);
return promise.then(data => MsgDeleteLimitParamsResponse.decode(new _m0.Reader(data)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export const createRPCQueryClient = async ({
delaymsg: (await import("./delaymsg/query.rpc.Query")).createRpcQueryExtension(client),
epochs: (await import("./epochs/query.rpc.Query")).createRpcQueryExtension(client),
feetiers: (await import("./feetiers/query.rpc.Query")).createRpcQueryExtension(client),
ibcratelimit: (await import("./ibcratelimit/query.rpc.Query")).createRpcQueryExtension(client),
perpetuals: (await import("./perpetuals/query.rpc.Query")).createRpcQueryExtension(client),
prices: (await import("./prices/query.rpc.Query")).createRpcQueryExtension(client),
ratelimit: (await import("./ratelimit/query.rpc.Query")).createRpcQueryExtension(client),
rewards: (await import("./rewards/query.rpc.Query")).createRpcQueryExtension(client),
sending: (await import("./sending/query.rpc.Query")).createRpcQueryExtension(client),
stats: (await import("./stats/query.rpc.Query")).createRpcQueryExtension(client),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export const createRPCMsgClient = async ({
clob: new (await import("./clob/tx.rpc.msg")).MsgClientImpl(rpc),
delaymsg: new (await import("./delaymsg/tx.rpc.msg")).MsgClientImpl(rpc),
feetiers: new (await import("./feetiers/tx.rpc.msg")).MsgClientImpl(rpc),
ibcratelimit: new (await import("./ibcratelimit/tx.rpc.msg")).MsgClientImpl(rpc),
perpetuals: new (await import("./perpetuals/tx.rpc.msg")).MsgClientImpl(rpc),
prices: new (await import("./prices/tx.rpc.msg")).MsgClientImpl(rpc),
ratelimit: new (await import("./ratelimit/tx.rpc.msg")).MsgClientImpl(rpc),
rewards: new (await import("./rewards/tx.rpc.msg")).MsgClientImpl(rpc),
sending: new (await import("./sending/tx.rpc.msg")).MsgClientImpl(rpc),
stats: new (await import("./stats/tx.rpc.msg")).MsgClientImpl(rpc),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
syntax = "proto3";
package dydxprotocol.ibcratelimit;
package dydxprotocol.ratelimit;

import "gogoproto/gogo.proto";

option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types";
option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types";

// DenomCapacity stores a list of rate limit capacity for a denom.
message DenomCapacity {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
syntax = "proto3";
package dydxprotocol.ibcratelimit;
package dydxprotocol.ratelimit;

import "gogoproto/gogo.proto";
import "dydxprotocol/ibcratelimit/limit_params.proto";
import "dydxprotocol/ratelimit/limit_params.proto";

option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types";
option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types";

// GenesisState defines the ibcratelimit module's genesis state.
// GenesisState defines the ratelimit module's genesis state.
message GenesisState {
// limit_params_list defines the list of `LimitParams` at genesis.
repeated LimitParams limit_params_list = 1 [ (gogoproto.nullable) = false ];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
syntax = "proto3";
package dydxprotocol.ibcratelimit;
package dydxprotocol.ratelimit;

import "gogoproto/gogo.proto";

option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types";
option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types";

// LimitParams defines rate limit params on a denom.
message LimitParams {
Expand All @@ -12,7 +12,7 @@ message LimitParams {
string denom = 1;
// limiters is a list of rate-limiters on this denom. All limiters
// must be satified for a withdrawal to proceed.
repeated Limiter limiters = 2;
repeated Limiter limiters = 2 [ (gogoproto.nullable) = false ];
}

// Limiter defines one rate-limiter on a specfic denom.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
syntax = "proto3";
package dydxprotocol.ibcratelimit;
package dydxprotocol.ratelimit;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "dydxprotocol/ibcratelimit/limit_params.proto";
import "dydxprotocol/ratelimit/limit_params.proto";

option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types";
option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types";

// Query defines the gRPC querier service.
service Query {
// List all limit params.
rpc ListLimitParams(ListLimitParamsRequest)
returns (ListLimitParamsResponse) {
option (google.api.http).get =
"/dydxprotocol/v4/ibcratelimit/list_limit_params";
"/dydxprotocol/v4/ratelimit/list_limit_params";
}

// Query capacity by denom.
rpc CapacityByDenom(QueryCapacityByDenomRequest)
returns (QueryCapacityByDenomResponse) {
option (google.api.http).get =
"/dydxprotocol/v4/ibcratelimit/capacity_by_denom";
"/dydxprotocol/v4/ratelimit/capacity_by_denom";
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package dydxprotocol.ibcratelimit;
package dydxprotocol.ratelimit;

option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types";
option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types";

import "cosmos/msg/v1/msg.proto";
import "dydxprotocol/ibcratelimit/limit_params.proto";
import "dydxprotocol/ratelimit/limit_params.proto";

// Msg defines the Msg service.
service Msg {
Expand Down
Loading
Loading