From 01fffeb486e5ab738638afcfa7dc64b9e3055b03 Mon Sep 17 00:00:00 2001 From: Teddy Ding Date: Mon, 11 Dec 2023 09:48:53 -0500 Subject: [PATCH 1/5] wip --- protocol/x/ibcratelimit/keeper/keeper.go | 112 +++++++++++++++++++++++ protocol/x/ibcratelimit/types/keys.go | 6 ++ 2 files changed, 118 insertions(+) diff --git a/protocol/x/ibcratelimit/keeper/keeper.go b/protocol/x/ibcratelimit/keeper/keeper.go index 881e17efa5..b8b09b3028 100644 --- a/protocol/x/ibcratelimit/keeper/keeper.go +++ b/protocol/x/ibcratelimit/keeper/keeper.go @@ -6,6 +6,7 @@ import ( sdklog "cosmossdk.io/log" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/dydxprotocol/v4-chain/protocol/lib" @@ -36,6 +37,117 @@ func NewKeeper( } } +// // Returns whether the withdrawal IBC transfer can proceed without getting rate limited. +// // It compares input amount vs. minimum capacity among all LimitParams for the denom. +// func (k Keeper) CanWithdraw( +// ctx sdk.Context, +// denom string, +// amount *sdkmath.Int, +// ) bool { +// denomCapacity := k.GetDenomCapacity(ctx, denom) +// for _, capacity := range denomCapacity.CapacityList { +// // Remaining capacity is the minimum of all LimitParams. +// if capacity.BigInt().Cmp(amount.BigInt()) <= 0 { +// return false +// } +// } +// return true +// } + +// ProcessDeposit processes a inbound IBC transfer, +// by updating the relevant capacity lists for the denom. +func (k Keeper) ProcessDeposit( + ctx sdk.Context, + denom string, + amount *sdk.Int, +) error { + denomCapacity := k.GetDenomCapacity(ctx, denom) + for _, capacity := range denomCapacity.CapacityList { + + } + return true +} + +// SetLimitParams sets `LimitParams` for the given denom. +func (k Keeper) SetLimitParams( + ctx sdk.Context, + limitParams types.LimitParams, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.DenomCapacityKeyPrefix)) + + key := []byte(limitParams.Denom) + // If there's no capacity entry to set, delete the key. + if len(limitParams.Limiters) == 0 { + if store.Has(key) { + store.Delete(key) + } + } else { + b := k.cdc.MustMarshal(&limitParams) + store.Set(key, b) + } +} + +// GetLimitParams returns `LimitParams` for the given denom. +func (k Keeper) GetLimitParams( + ctx sdk.Context, + denom string, +) (val types.LimitParams) { + // Check state for the LimitParams. + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.LimitParamsKeyPrefix)) + b := store.Get([]byte(denom)) + + // If LimitParams does not exist in state, return a default value. + if b == nil { + return types.LimitParams{ + Denom: denom, + } + } + + // If LimitParams does exist in state, unmarshall and return the value. + k.cdc.MustUnmarshal(b, &val) + return val +} + +// SetDenomCapacity sets `DenomCapacity` for the given denom. +func (k Keeper) SetDenomCapacity( + ctx sdk.Context, + denomCapacity types.DenomCapacity, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.DenomCapacityKeyPrefix)) + + key := []byte(denomCapacity.Denom) + // If there's no capacity entry to set, delete the key. + if len(denomCapacity.CapacityList) == 0 { + if store.Has(key) { + store.Delete(key) + } + } else { + b := k.cdc.MustMarshal(&denomCapacity) + store.Set(key, b) + } +} + +// GetDenomCapacity returns `DenomCapacity` for the given denom. +func (k Keeper) GetDenomCapacity( + ctx sdk.Context, + denom string, +) (val types.DenomCapacity) { + // Check state for the DenomCapacity. + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.DenomCapacityKeyPrefix)) + b := store.Get([]byte(denom)) + + // If DenomCapacity does not exist in state, return a default value. + if b == nil { + return types.DenomCapacity{ + Denom: denom, + } + } + + // If DenomCapacity does exist in state, unmarshall and return the value. + k.cdc.MustUnmarshal(b, &val) + return val +} + func (k Keeper) HasAuthority(authority string) bool { _, ok := k.authorities[authority] return ok diff --git a/protocol/x/ibcratelimit/types/keys.go b/protocol/x/ibcratelimit/types/keys.go index acca10b0f8..0d531264bf 100644 --- a/protocol/x/ibcratelimit/types/keys.go +++ b/protocol/x/ibcratelimit/types/keys.go @@ -7,6 +7,12 @@ const ( // StoreKey defines the primary module store key StoreKey = ModuleName + + // DenomCapacityKeyPrefix is the prefix for the key-value store for DenomCapacity + DenomCapacityKeyPrefix = "DenomCapacity:" + + // LimitParamsKeyPrefix is the prefix for the key-value store for LimitParams + LimitParamsKeyPrefix = "LimitParams:" ) // State From 285d498143a73ddb2f6491c5c5f089a07e517884 Mon Sep 17 00:00:00 2001 From: Teddy Ding Date: Mon, 11 Dec 2023 15:04:57 -0500 Subject: [PATCH 2/5] initial PR for x/ibcratelimit keeper --- .../ibcratelimit/limit_params.proto | 4 +- protocol/app/app.go | 21 +++ protocol/x/ibcratelimit/keeper/keeper.go | 153 ++++++++++++++---- protocol/x/ibcratelimit/keeper/keeper_test.go | 121 ++++++++++++++ protocol/x/ibcratelimit/types/errors.go | 5 + protocol/x/ibcratelimit/types/keys.go | 3 +- .../x/ibcratelimit/types/limit_params.pb.go | 50 +++--- 7 files changed, 301 insertions(+), 56 deletions(-) diff --git a/proto/dydxprotocol/ibcratelimit/limit_params.proto b/proto/dydxprotocol/ibcratelimit/limit_params.proto index d5bb20762b..1f4a55481a 100644 --- a/proto/dydxprotocol/ibcratelimit/limit_params.proto +++ b/proto/dydxprotocol/ibcratelimit/limit_params.proto @@ -12,7 +12,9 @@ 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. diff --git a/protocol/app/app.go b/protocol/app/app.go index 6a6b04fb61..f4ee2f0939 100644 --- a/protocol/app/app.go +++ b/protocol/app/app.go @@ -143,6 +143,8 @@ import ( feetiersmodule "github.com/dydxprotocol/v4-chain/protocol/x/feetiers" feetiersmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/feetiers/keeper" feetiersmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/feetiers/types" + ibcratelimitmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/keeper" + ibcratelimitmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" perpetualsmodule "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals" perpetualsmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/keeper" perpetualsmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" @@ -152,6 +154,7 @@ import ( rewardsmodule "github.com/dydxprotocol/v4-chain/protocol/x/rewards" rewardsmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/rewards/keeper" rewardsmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/rewards/types" + sendingmodule "github.com/dydxprotocol/v4-chain/protocol/x/sending" sendingmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/sending/keeper" sendingmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/sending/types" @@ -237,6 +240,7 @@ type App struct { IBCKeeper *ibckeeper.Keeper EvidenceKeeper evidencekeeper.Keeper TransferKeeper ibctransferkeeper.Keeper + IBCRateLimitKeeper ibcratelimitmodulekeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper @@ -343,6 +347,7 @@ func New( distrtypes.StoreKey, slashingtypes.StoreKey, govtypes.StoreKey, paramstypes.StoreKey, consensusparamtypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, ibcexported.StoreKey, ibctransfertypes.StoreKey, + ibcratelimitmoduletypes.StoreKey, evidencetypes.StoreKey, capabilitytypes.StoreKey, pricesmoduletypes.StoreKey, @@ -533,6 +538,18 @@ func New( transferModule := transfer.NewAppModule(app.TransferKeeper) transferIBCModule := transfer.NewIBCModule(app.TransferKeeper) + app.IBCRateLimitKeeper = *ibcratelimitmodulekeeper.NewKeeper( + appCodec, + keys[ibcratelimitmoduletypes.StoreKey], + // set the governance and delaymsg module accounts as the authority for conducting upgrades + []string{ + lib.GovModuleAddress.String(), + delaymsgmoduletypes.ModuleAddress.String(), + }, + ) + + // TODO(CORE-834): Add IBCRatelimitKeeper to the IBC transfer stack. + // Create static IBC router, add transfer route, then set and seal it ibcRouter := ibcporttypes.NewRouter() ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule) @@ -972,6 +989,7 @@ func New( stakingtypes.ModuleName, ibcexported.ModuleName, ibctransfertypes.ModuleName, + ibcratelimitmoduletypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, govtypes.ModuleName, @@ -1014,6 +1032,7 @@ func New( upgradetypes.ModuleName, ibcexported.ModuleName, ibctransfertypes.ModuleName, + ibcratelimitmoduletypes.ModuleName, consensusparamtypes.ModuleName, pricesmoduletypes.ModuleName, assetsmoduletypes.ModuleName, @@ -1052,6 +1071,7 @@ func New( paramstypes.ModuleName, upgradetypes.ModuleName, ibctransfertypes.ModuleName, + ibcratelimitmoduletypes.ModuleName, feegrant.ModuleName, consensusparamtypes.ModuleName, pricesmoduletypes.ModuleName, @@ -1087,6 +1107,7 @@ func New( paramstypes.ModuleName, upgradetypes.ModuleName, ibctransfertypes.ModuleName, + ibcratelimitmoduletypes.ModuleName, feegrant.ModuleName, consensusparamtypes.ModuleName, pricesmoduletypes.ModuleName, diff --git a/protocol/x/ibcratelimit/keeper/keeper.go b/protocol/x/ibcratelimit/keeper/keeper.go index b8b09b3028..48f5b603a6 100644 --- a/protocol/x/ibcratelimit/keeper/keeper.go +++ b/protocol/x/ibcratelimit/keeper/keeper.go @@ -2,17 +2,26 @@ package keeper import ( "fmt" + "math/big" + errorsmod "cosmossdk.io/errors" sdklog "cosmossdk.io/log" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/dydxprotocol/v4-chain/protocol/dtypes" "github.com/dydxprotocol/v4-chain/protocol/lib" "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" ) +var ( + // TempTVLPlacerholder is a placeholder value for TVL. + // TODO(CORE-836): Remove this after `GetBaseline` is fully implemented. + TempTVLPlacerholder = big.NewInt(20_000_000_000_000) +) + type ( Keeper struct { cdc codec.BinaryCodec @@ -37,54 +46,140 @@ func NewKeeper( } } -// // Returns whether the withdrawal IBC transfer can proceed without getting rate limited. -// // It compares input amount vs. minimum capacity among all LimitParams for the denom. -// func (k Keeper) CanWithdraw( -// ctx sdk.Context, -// denom string, -// amount *sdkmath.Int, -// ) bool { -// denomCapacity := k.GetDenomCapacity(ctx, denom) -// for _, capacity := range denomCapacity.CapacityList { -// // Remaining capacity is the minimum of all LimitParams. -// if capacity.BigInt().Cmp(amount.BigInt()) <= 0 { -// return false -// } -// } -// return true -// } +// ProcessWithdrawal processes an outbound IBC transfer, +// by updating the capacity lists for the denom. +func (k Keeper) ProcessWithdrawal( + ctx sdk.Context, + denom string, + amount *big.Int, +) error { + denomCapacity := k.GetDenomCapacity(ctx, denom) + + newCapacityList := make([]dtypes.SerializableInt, + 0, + len(denomCapacity.CapacityList), + ) + + for i, capacity := range denomCapacity.CapacityList { + // Check that the withdrawal amount does not exceed each capacity. + if capacity.BigInt().Cmp(amount) < 0 { + return errorsmod.Wrapf( + types.ErrWithdrawalExceedsCapacity, + "denom = %v, capacity(index: %v) = %v, amount = %v", + denom, + i, + capacity.BigInt(), + amount, + ) + } + + // Debit each capacity in the list by the amount of withdrawal. + newCapacityList[i] = dtypes.NewIntFromBigInt( + new(big.Int).Sub( + capacity.BigInt(), + amount, + ), + ) + } + + k.SetDenomCapacity(ctx, types.DenomCapacity{ + Denom: denom, + CapacityList: newCapacityList, + }) + + return nil +} // ProcessDeposit processes a inbound IBC transfer, -// by updating the relevant capacity lists for the denom. +// by updating the capacity lists for the denom. func (k Keeper) ProcessDeposit( ctx sdk.Context, denom string, - amount *sdk.Int, -) error { + amount *big.Int, +) { denomCapacity := k.GetDenomCapacity(ctx, denom) - for _, capacity := range denomCapacity.CapacityList { + newCapacityList := make([]dtypes.SerializableInt, + 0, + len(denomCapacity.CapacityList), + ) + + // Credit each capacity in the list by the amount of deposit. + for i, capacity := range denomCapacity.CapacityList { + newCapacityList[i] = dtypes.NewIntFromBigInt( + new(big.Int).Add( + capacity.BigInt(), + amount, + ), + ) } - return true + + k.SetDenomCapacity(ctx, types.DenomCapacity{ + Denom: denom, + CapacityList: newCapacityList, + }) +} + +// GetBaseline returns the current capacity baseline for the given limiter. +// `baseline` formula: +// +// baseline = max(baseline_minimum, baseline_tvl_ppm * current_tvl) +func (k Keeper) GetBaseline( + ctx sdk.Context, + denom string, + limiter types.Limiter, +) *big.Int { + // Get the current TVL. + // TODO(CORE-836): Query bank Keeper to get current supply of the token. + currentTVL := TempTVLPlacerholder + + return lib.BigMax( + limiter.BaselineMinimum.BigInt(), + lib.BigIntMulPpm( + currentTVL, + limiter.BaselineTvlPpm, + ), + ) } // SetLimitParams sets `LimitParams` for the given denom. +// Also overwrites the existing `DenomCapacity` object for the denom with a default `capacity_list` of the +// same length as the `limiters` list. Each `capacity` is initialized to the current baseline. func (k Keeper) SetLimitParams( ctx sdk.Context, limitParams types.LimitParams, ) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.DenomCapacityKeyPrefix)) + limitParamsStore := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.LimitParamsKeyPrefix)) + denomCapacityStore := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.DenomCapacityKeyPrefix)) - key := []byte(limitParams.Denom) - // If there's no capacity entry to set, delete the key. + denomKey := []byte(limitParams.Denom) + // If the length of input limit params is zero, then remove both the + // limit params and the denom capacity in state. if len(limitParams.Limiters) == 0 { - if store.Has(key) { - store.Delete(key) + if limitParamsStore.Has(denomKey) { + limitParamsStore.Delete(denomKey) } - } else { - b := k.cdc.MustMarshal(&limitParams) - store.Set(key, b) + if denomCapacityStore.Has(denomKey) { + denomCapacityStore.Delete(denomKey) + } + return + } + + // Initialize the capacity list with the current baseline. + newCapacityList := make([]dtypes.SerializableInt, len(limitParams.Limiters)) + for i, limiter := range limitParams.Limiters { + newCapacityList[i] = dtypes.NewIntFromBigInt( + k.GetBaseline(ctx, limitParams.Denom, limiter), + ) } + // Set correspondong `DenomCapacity` in state. + k.SetDenomCapacity(ctx, types.DenomCapacity{ + Denom: limitParams.Denom, + CapacityList: newCapacityList, + }) + + b := k.cdc.MustMarshal(&limitParams) + limitParamsStore.Set(denomKey, b) } // GetLimitParams returns `LimitParams` for the given denom. diff --git a/protocol/x/ibcratelimit/keeper/keeper_test.go b/protocol/x/ibcratelimit/keeper/keeper_test.go index 9429264902..7defd197a6 100644 --- a/protocol/x/ibcratelimit/keeper/keeper_test.go +++ b/protocol/x/ibcratelimit/keeper/keeper_test.go @@ -1 +1,122 @@ package keeper_test + +import ( + "testing" + + "github.com/dydxprotocol/v4-chain/protocol/dtypes" + testapp "github.com/dydxprotocol/v4-chain/protocol/testutil/app" + "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" + "github.com/stretchr/testify/require" +) + +const ( + testDenom = "ibc/xxx" +) + +func TestSetGetDenomCapacity(t *testing.T) { + tApp := testapp.NewTestAppBuilder(t).Build() + ctx := tApp.InitChain() + k := tApp.App.IBCRateLimitKeeper + + capacityList := []dtypes.SerializableInt{ + dtypes.NewInt(123_456_789), + dtypes.NewInt(500_000_000), + } + denomCapacity := types.DenomCapacity{ + Denom: testDenom, + CapacityList: capacityList, + } + + // Test SetDenomCapacity + k.SetDenomCapacity(ctx, denomCapacity) + + // Test GetDenomCapacity + gotDenomCapacity := k.GetDenomCapacity(ctx, testDenom) + require.Equal(t, denomCapacity, gotDenomCapacity, "retrieved DenomCapacity does not match the set value") + + k.SetDenomCapacity(ctx, types.DenomCapacity{ + Denom: testDenom, + CapacityList: []dtypes.SerializableInt{}, // Empty list, results in deletion of the key. + }) + + // Check that the key is deleted under `DenomCapacity` storage. + require.Equal(t, + types.DenomCapacity{ + Denom: testDenom, + CapacityList: nil, + }, + k.GetDenomCapacity(ctx, testDenom), + "retrieved LimitParams do not match the set value", + ) +} + +func TestSetGetLimitParams_Success(t *testing.T) { + tApp := testapp.NewTestAppBuilder(t).Build() + ctx := tApp.InitChain() + k := tApp.App.IBCRateLimitKeeper + + limiters := []types.Limiter{ + { + PeriodSec: 3_600, + BaselineMinimum: dtypes.NewInt(100_000_000_000), // 100k tokens (assuming 6 decimals) + BaselineTvlPpm: 10_000, // 1% + }, + { + PeriodSec: 86_400, + BaselineMinimum: dtypes.NewInt(1_000_000_000_000), // 1m tokens (assuming 6 decimals) + BaselineTvlPpm: 100_000, // 10% + }, + } + limitParams := types.LimitParams{ + Denom: testDenom, + Limiters: limiters, + } + + // Test SetLimitParams + k.SetLimitParams(ctx, limitParams) + + // Test GetLimitParams + gotLimitParams := k.GetLimitParams(ctx, testDenom) + require.Equal(t, limitParams, gotLimitParams, "retrieved LimitParams do not match the set value") + + // Query for `DenomCapacity` of `testDenom`. + gotDenomCapacity := k.GetDenomCapacity(ctx, testDenom) + // Expected `DenomCapacity` is initialized such that each capacity is equal to the baseline. + expectedDenomCapacity := types.DenomCapacity{ + Denom: testDenom, + CapacityList: []dtypes.SerializableInt{ + // TODO(CORE-834): Update expected value after `GetBaseline` depends on current TVL. + dtypes.NewInt(200_000_000_000), // 200k tokens (assuming 6 decimals) + dtypes.NewInt(2_000_000_000_000), // 1m tokens (assuming 6 decimals) + }, + } + require.Equal(t, expectedDenomCapacity, gotDenomCapacity, "retrieved DenomCapacity does not match the set value") + + // Set empty `LimitParams` for `testDenom`. + k.SetLimitParams(ctx, types.LimitParams{ + Denom: testDenom, + Limiters: []types.Limiter{}, // Empty list, results in deletion of the key. + }) + + // Check that the key is deleted under `LimitParams` storage. + require.Equal(t, + types.LimitParams{ + Denom: testDenom, + Limiters: nil, + }, + k.GetLimitParams(ctx, testDenom), + "retrieved LimitParams do not match the set value") + + // Check that the key is deleted under `DenomCapacity` storage. + require.Equal(t, + types.DenomCapacity{ + Denom: testDenom, + CapacityList: nil, + }, + k.GetDenomCapacity(ctx, testDenom), + "retrieved LimitParams do not match the set value") +} + +func TestGetBaseline(t *testing.T) { + // TODO(CORE-836): Add test for GetBaseline. +} diff --git a/protocol/x/ibcratelimit/types/errors.go b/protocol/x/ibcratelimit/types/errors.go index 77e464d922..839fb65533 100644 --- a/protocol/x/ibcratelimit/types/errors.go +++ b/protocol/x/ibcratelimit/types/errors.go @@ -11,4 +11,9 @@ var ( 1001, "Authority is invalid", ) + ErrWithdrawalExceedsCapacity = errorsmod.Register( + ModuleName, + 1002, + "withdrawal amount would exceed rate-limit capacity", + ) ) diff --git a/protocol/x/ibcratelimit/types/keys.go b/protocol/x/ibcratelimit/types/keys.go index 0d531264bf..499ee30ebf 100644 --- a/protocol/x/ibcratelimit/types/keys.go +++ b/protocol/x/ibcratelimit/types/keys.go @@ -3,7 +3,8 @@ package types // Module name and store keys const ( // ModuleName defines the module name - ModuleName = "ibcratelimit" + // Use `ratelimit` instead of `ibcratelimit` to prevent potential key space conflicts with the IBC module. + ModuleName = "ratelimit" // StoreKey defines the primary module store key StoreKey = ModuleName diff --git a/protocol/x/ibcratelimit/types/limit_params.pb.go b/protocol/x/ibcratelimit/types/limit_params.pb.go index c90d500f5c..b77fb539ad 100644 --- a/protocol/x/ibcratelimit/types/limit_params.pb.go +++ b/protocol/x/ibcratelimit/types/limit_params.pb.go @@ -31,7 +31,7 @@ type LimitParams struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` // limiters is a list of rate-limiters on this denom. All limiters // must be satified for a withdrawal to proceed. - Limiters []*Limiter `protobuf:"bytes,2,rep,name=limiters,proto3" json:"limiters,omitempty"` + Limiters []Limiter `protobuf:"bytes,2,rep,name=limiters,proto3" json:"limiters"` } func (m *LimitParams) Reset() { *m = LimitParams{} } @@ -74,7 +74,7 @@ func (m *LimitParams) GetDenom() string { return "" } -func (m *LimitParams) GetLimiters() []*Limiter { +func (m *LimitParams) GetLimiters() []Limiter { if m != nil { return m.Limiters } @@ -153,28 +153,28 @@ func init() { } var fileDescriptor_9b1618a221d924d8 = []byte{ - // 329 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0xcf, 0x4b, 0xfb, 0x30, - 0x1c, 0x6d, 0xb6, 0xef, 0x57, 0x5d, 0xe6, 0x2f, 0xca, 0x0e, 0x55, 0xb0, 0x2b, 0x3b, 0xf5, 0xa0, - 0x2d, 0xa8, 0xe7, 0x21, 0x3b, 0x29, 0x4c, 0x18, 0x9d, 0x07, 0xf1, 0x52, 0xd2, 0x34, 0x6c, 0x81, - 0xa4, 0x09, 0x4d, 0x36, 0x36, 0xff, 0x0a, 0xff, 0x2b, 0x77, 0xdc, 0x51, 0x3c, 0x0c, 0xd9, 0xfe, - 0x11, 0x59, 0xea, 0x46, 0x77, 0x10, 0xbc, 0x84, 0xe4, 0xbd, 0xf7, 0x79, 0xef, 0x91, 0x0f, 0xbc, - 0x4c, 0xa7, 0xe9, 0x44, 0xe6, 0x42, 0x0b, 0x2c, 0x58, 0x48, 0x13, 0x9c, 0x23, 0x4d, 0x18, 0xe5, - 0x54, 0x87, 0xe6, 0x8c, 0x25, 0xca, 0x11, 0x57, 0x81, 0x91, 0xd8, 0x67, 0x65, 0x75, 0x50, 0x56, - 0x9f, 0x37, 0x06, 0x62, 0x20, 0x0c, 0x15, 0xae, 0x6f, 0xc5, 0x40, 0x0b, 0xc3, 0x7a, 0x77, 0x4d, - 0xf7, 0x8c, 0x8b, 0xdd, 0x80, 0xff, 0x53, 0x92, 0x09, 0xee, 0x00, 0x0f, 0xf8, 0xb5, 0xa8, 0x78, - 0xd8, 0x6d, 0x78, 0x60, 0x3c, 0x48, 0xae, 0x9c, 0x8a, 0x57, 0xf5, 0xeb, 0xd7, 0xad, 0xe0, 0xd7, - 0xa0, 0xa0, 0x5b, 0x48, 0xa3, 0xed, 0x4c, 0xeb, 0x1d, 0xc0, 0xfd, 0x1f, 0xd4, 0xbe, 0x80, 0x50, - 0x92, 0x9c, 0x8a, 0x34, 0x56, 0x04, 0x3b, 0x15, 0x0f, 0xf8, 0x47, 0x51, 0xad, 0x40, 0xfa, 0x04, - 0xdb, 0x0a, 0x9e, 0x26, 0x48, 0x11, 0x46, 0x33, 0x12, 0x73, 0x9a, 0x51, 0x3e, 0xe2, 0x4e, 0xd5, - 0x03, 0xfe, 0x61, 0xe7, 0x7e, 0xb6, 0x68, 0x5a, 0x9f, 0x8b, 0xe6, 0xdd, 0x80, 0xea, 0xe1, 0x28, - 0x09, 0xb0, 0xe0, 0xe1, 0xce, 0xdf, 0x8c, 0x6f, 0xaf, 0xf0, 0x10, 0xd1, 0x2c, 0xdc, 0x22, 0xa9, - 0x9e, 0x4a, 0xa2, 0x82, 0x3e, 0xc9, 0x29, 0x62, 0xf4, 0x15, 0x25, 0x8c, 0x3c, 0x64, 0x3a, 0x3a, - 0xd9, 0x24, 0x3c, 0x16, 0x01, 0xb6, 0x5f, 0x0a, 0xd5, 0x63, 0x16, 0x4b, 0xc9, 0x9d, 0x7f, 0xa6, - 0xd9, 0xf1, 0x06, 0x7f, 0x1a, 0xb3, 0x9e, 0xe4, 0x9d, 0xe7, 0xd9, 0xd2, 0x05, 0xf3, 0xa5, 0x0b, - 0xbe, 0x96, 0x2e, 0x78, 0x5b, 0xb9, 0xd6, 0x7c, 0xe5, 0x5a, 0x1f, 0x2b, 0xd7, 0x7a, 0x69, 0xff, - 0xbd, 0xd6, 0x64, 0x77, 0x8d, 0xa6, 0x64, 0xb2, 0x67, 0xe8, 0x9b, 0xef, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xc0, 0x7d, 0x29, 0xe5, 0xf0, 0x01, 0x00, 0x00, + // 332 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51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e9, 0xd2, 0xd8, 0xcc, 0xf1, 0x49, 0x44, 0x72, 0xca, 0x20, 0xa5, 0x21, 0x87, + 0x14, 0xf8, 0x80, 0x5b, 0x65, 0x07, 0xb9, 0x07, 0xad, 0x87, 0xa5, 0xe9, 0xd7, 0xac, 0x71, 0xd7, + 0x03, 0xd5, 0x1f, 0x44, 0x5e, 0x2c, 0xb8, 0xbf, 0xf5, 0x43, 0xc3, 0x9b, 0xcb, 0xb8, 0x4f, 0x20, + 0xf5, 0xd7, 0x48, 0xa2, 0xc6, 0x92, 0xe6, 0x5e, 0x97, 0x66, 0x40, 0x18, 0xbc, 0x91, 0x88, 0xd1, + 0xc7, 0x54, 0x05, 0xc7, 0xab, 0x84, 0xa7, 0x22, 0xc0, 0x74, 0x37, 0x42, 0xd5, 0x90, 0x85, 0x52, + 0x72, 0xab, 0xa2, 0x9b, 0x1d, 0xad, 0xf0, 0xe7, 0x21, 0xeb, 0x48, 0xde, 0x7a, 0x99, 0xcc, 0x6d, + 0x34, 0x9d, 0xdb, 0xe8, 0x7b, 0x6e, 0xa3, 0xf7, 0x85, 0x6d, 0x4c, 0x17, 0xb6, 0xf1, 0xb9, 0xb0, + 0x8d, 0xd7, 0xdb, 0xff, 0xd7, 0x1a, 0x6d, 0x2f, 0x53, 0x97, 0x8c, 0x76, 0x35, 0x7d, 0xfd, 0x13, + 0x00, 0x00, 0xff, 0xff, 0x8b, 0x2d, 0xf3, 0x81, 0xf6, 0x01, 0x00, 0x00, } func (m *LimitParams) Marshal() (dAtA []byte, err error) { @@ -407,7 +407,7 @@ func (m *LimitParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Limiters = append(m.Limiters, &Limiter{}) + m.Limiters = append(m.Limiters, Limiter{}) if err := m.Limiters[len(m.Limiters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } From 420afa63ae516bc00053014d1fb79c1e2154de03 Mon Sep 17 00:00:00 2001 From: Teddy Ding Date: Mon, 11 Dec 2023 15:11:15 -0500 Subject: [PATCH 3/5] proto format --- proto/dydxprotocol/ibcratelimit/limit_params.proto | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/proto/dydxprotocol/ibcratelimit/limit_params.proto b/proto/dydxprotocol/ibcratelimit/limit_params.proto index 1f4a55481a..eac8b2d68d 100644 --- a/proto/dydxprotocol/ibcratelimit/limit_params.proto +++ b/proto/dydxprotocol/ibcratelimit/limit_params.proto @@ -12,9 +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 [ - (gogoproto.nullable) = false - ]; + repeated Limiter limiters = 2 [ (gogoproto.nullable) = false ]; } // Limiter defines one rate-limiter on a specfic denom. From cc506a639eadb878df298b63e876417a082c0373 Mon Sep 17 00:00:00 2001 From: Teddy Ding Date: Tue, 12 Dec 2023 10:18:47 -0500 Subject: [PATCH 4/5] address nits, change name --- .../src/codegen/dydxprotocol/bundle.ts | 18 ++-- .../dydxprotocol/ibcratelimit/genesis.ts | 4 +- .../dydxprotocol/ibcratelimit/query.lcd.ts | 4 +- .../ibcratelimit/query.rpc.Query.ts | 4 +- .../dydxprotocol/ibcratelimit/tx.rpc.msg.ts | 4 +- .../v4-protos/src/codegen/dydxprotocol/lcd.ts | 2 +- .../src/codegen/dydxprotocol/rpc.query.ts | 2 +- .../src/codegen/dydxprotocol/rpc.tx.ts | 2 +- .../capacity.proto | 4 +- .../{ibcratelimit => ratelimit}/genesis.proto | 8 +- .../limit_params.proto | 4 +- .../{ibcratelimit => ratelimit}/query.proto | 10 +- .../{ibcratelimit => ratelimit}/tx.proto | 6 +- protocol/app/app.go | 23 +++-- .../x/ibcratelimit/keeper/msg_server_test.go | 3 - .../client/cli/query.go | 6 +- .../client/cli/query_params.go | 2 +- .../client/cli/query_params_test.go | 2 +- .../client/cli/tx.go | 2 +- .../x/{ibcratelimit => ratelimit}/genesis.go | 6 +- .../genesis_test.go | 2 +- .../keeper/grpc_query.go | 6 +- .../keeper/grpc_query_test.go | 2 +- .../keeper/keeper.go | 4 +- .../keeper/keeper_test.go | 6 +- .../keeper/msg_server.go | 2 +- .../x/ratelimit/keeper/msg_server_test.go | 3 + .../x/{ibcratelimit => ratelimit}/module.go | 8 +- .../module_simulation.go | 12 +-- .../module_test.go | 2 +- .../simulation/helpers.go | 0 .../types/capacity.pb.go | 42 ++++---- .../types/codec.go | 0 .../types/errors.go | 2 +- .../types/expected_keepers.go | 0 .../types/genesis.go | 0 .../types/genesis.pb.go | 42 ++++---- .../types/genesis_test.go | 0 .../{ibcratelimit => ratelimit}/types/keys.go | 2 +- .../types/keys_test.go | 6 +- .../types/limit_params.pb.go | 56 +++++------ .../types/params.go | 0 .../types/query.pb.go | 98 +++++++++---------- .../types/query.pb.gw.go | 6 +- .../x/{ibcratelimit => ratelimit}/types/tx.go | 0 .../types/tx.pb.go | 86 ++++++++-------- .../types/types.go | 0 47 files changed, 250 insertions(+), 253 deletions(-) rename proto/dydxprotocol/{ibcratelimit => ratelimit}/capacity.proto (92%) rename proto/dydxprotocol/{ibcratelimit => ratelimit}/genesis.proto (62%) rename proto/dydxprotocol/{ibcratelimit => ratelimit}/limit_params.proto (95%) rename proto/dydxprotocol/{ibcratelimit => ratelimit}/query.proto (85%) rename proto/dydxprotocol/{ibcratelimit => ratelimit}/tx.proto (92%) delete mode 100644 protocol/x/ibcratelimit/keeper/msg_server_test.go rename protocol/x/{ibcratelimit => ratelimit}/client/cli/query.go (75%) rename protocol/x/{ibcratelimit => ratelimit}/client/cli/query_params.go (64%) rename protocol/x/{ibcratelimit => ratelimit}/client/cli/query_params_test.go (76%) rename protocol/x/{ibcratelimit => ratelimit}/client/cli/tx.go (90%) rename protocol/x/{ibcratelimit => ratelimit}/genesis.go (75%) rename protocol/x/{ibcratelimit => ratelimit}/genesis_test.go (79%) rename protocol/x/{ibcratelimit => ratelimit}/keeper/grpc_query.go (76%) rename protocol/x/{ibcratelimit => ratelimit}/keeper/grpc_query_test.go (59%) rename protocol/x/{ibcratelimit => ratelimit}/keeper/keeper.go (98%) rename protocol/x/{ibcratelimit => ratelimit}/keeper/keeper_test.go (96%) rename protocol/x/{ibcratelimit => ratelimit}/keeper/msg_server.go (94%) create mode 100644 protocol/x/ratelimit/keeper/msg_server_test.go rename protocol/x/{ibcratelimit => ratelimit}/module.go (96%) rename protocol/x/{ibcratelimit => ratelimit}/module_simulation.go (82%) rename protocol/x/{ibcratelimit => ratelimit}/module_test.go (62%) rename protocol/x/{ibcratelimit => ratelimit}/simulation/helpers.go (100%) rename protocol/x/{ibcratelimit => ratelimit}/types/capacity.pb.go (83%) rename protocol/x/{ibcratelimit => ratelimit}/types/codec.go (100%) rename protocol/x/{ibcratelimit => ratelimit}/types/errors.go (88%) rename protocol/x/{ibcratelimit => ratelimit}/types/expected_keepers.go (100%) rename protocol/x/{ibcratelimit => ratelimit}/types/genesis.go (100%) rename protocol/x/{ibcratelimit => ratelimit}/types/genesis.pb.go (80%) rename protocol/x/{ibcratelimit => ratelimit}/types/genesis_test.go (100%) rename protocol/x/{ibcratelimit => ratelimit}/types/keys.go (80%) rename protocol/x/{ibcratelimit => ratelimit}/types/keys_test.go (53%) rename protocol/x/{ibcratelimit => ratelimit}/types/limit_params.pb.go (85%) rename protocol/x/{ibcratelimit => ratelimit}/types/params.go (100%) rename protocol/x/{ibcratelimit => ratelimit}/types/query.pb.go (87%) rename protocol/x/{ibcratelimit => ratelimit}/types/query.pb.gw.go (97%) rename protocol/x/{ibcratelimit => ratelimit}/types/tx.go (100%) rename protocol/x/{ibcratelimit => ratelimit}/types/tx.pb.go (88%) rename protocol/x/{ibcratelimit => ratelimit}/types/types.go (100%) diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts index d2548c5d77..b79929bc81 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts @@ -42,11 +42,11 @@ 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 _49 from "./ratelimit/capacity"; +import * as _50 from "./ratelimit/genesis"; +import * as _51 from "./ratelimit/limit_params"; +import * as _52 from "./ratelimit/query"; +import * as _53 from "./ratelimit/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"; @@ -95,7 +95,7 @@ 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 _109 from "./ratelimit/query.lcd"; import * as _110 from "./perpetuals/query.lcd"; import * as _111 from "./prices/query.lcd"; import * as _112 from "./rewards/query.lcd"; @@ -109,7 +109,7 @@ 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 _123 from "./ratelimit/query.rpc.Query"; import * as _124 from "./perpetuals/query.rpc.Query"; import * as _125 from "./prices/query.rpc.Query"; import * as _126 from "./rewards/query.rpc.Query"; @@ -122,7 +122,7 @@ 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 _136 from "./ratelimit/tx.rpc.msg"; import * as _137 from "./perpetuals/tx.rpc.msg"; import * as _138 from "./prices/tx.rpc.msg"; import * as _139 from "./rewards/tx.rpc.msg"; @@ -208,7 +208,7 @@ export namespace dydxprotocol { ..._122, ..._135 }; - export const ibcratelimit = { ..._49, + export const ratelimit = { ..._49, ..._50, ..._51, ..._52, diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts index 35956f214f..eecf484f37 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts @@ -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. */ diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts index 5b66647ae5..88809acdff 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts @@ -16,7 +16,7 @@ export class LCDQueryClient { async listLimitParams(_params: ListLimitParamsRequest = {}): Promise { - const endpoint = `dydxprotocol/v4/ibcratelimit/list_limit_params`; + const endpoint = `dydxprotocol/v4/ratelimit/list_limit_params`; return await this.req.get(endpoint); } /* Query capacity by denom. */ @@ -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(endpoint, options); } diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts index 309d7e014a..c617aa46f4 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts @@ -22,13 +22,13 @@ export class QueryClientImpl implements Query { listLimitParams(request: ListLimitParamsRequest = {}): Promise { 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 { 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))); } diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts index 5a4a6a1bd1..dac9998fa2 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts @@ -21,13 +21,13 @@ export class MsgClientImpl implements Msg { setLimitParams(request: MsgSetLimitParams): Promise { 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 { 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))); } diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts index e246bd66ba..fe64a9d258 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts @@ -30,7 +30,7 @@ export const createLCDClient = async ({ feetiers: new (await import("./feetiers/query.lcd")).LCDQueryClient({ requestClient }), - ibcratelimit: new (await import("./ibcratelimit/query.lcd")).LCDQueryClient({ + ratelimit: new (await import("./ratelimit/query.lcd")).LCDQueryClient({ requestClient }), perpetuals: new (await import("./perpetuals/query.lcd")).LCDQueryClient({ diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts index 336945f441..dfc0119806 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts @@ -16,7 +16,7 @@ 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), + ratelimit: (await import("./ratelimit/query.rpc.Query")).createRpcQueryExtension(client), perpetuals: (await import("./perpetuals/query.rpc.Query")).createRpcQueryExtension(client), prices: (await import("./prices/query.rpc.Query")).createRpcQueryExtension(client), rewards: (await import("./rewards/query.rpc.Query")).createRpcQueryExtension(client), diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts index 629f261698..8dfac14795 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts @@ -10,7 +10,7 @@ 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), + ratelimit: new (await import("./ratelimit/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), rewards: new (await import("./rewards/tx.rpc.msg")).MsgClientImpl(rpc), diff --git a/proto/dydxprotocol/ibcratelimit/capacity.proto b/proto/dydxprotocol/ratelimit/capacity.proto similarity index 92% rename from proto/dydxprotocol/ibcratelimit/capacity.proto rename to proto/dydxprotocol/ratelimit/capacity.proto index 00f1a1c1ff..8e72c93a34 100644 --- a/proto/dydxprotocol/ibcratelimit/capacity.proto +++ b/proto/dydxprotocol/ratelimit/capacity.proto @@ -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 { diff --git a/proto/dydxprotocol/ibcratelimit/genesis.proto b/proto/dydxprotocol/ratelimit/genesis.proto similarity index 62% rename from proto/dydxprotocol/ibcratelimit/genesis.proto rename to proto/dydxprotocol/ratelimit/genesis.proto index 0c9d563fd3..b15662a3e5 100644 --- a/proto/dydxprotocol/ibcratelimit/genesis.proto +++ b/proto/dydxprotocol/ratelimit/genesis.proto @@ -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 ]; diff --git a/proto/dydxprotocol/ibcratelimit/limit_params.proto b/proto/dydxprotocol/ratelimit/limit_params.proto similarity index 95% rename from proto/dydxprotocol/ibcratelimit/limit_params.proto rename to proto/dydxprotocol/ratelimit/limit_params.proto index eac8b2d68d..5df88b3da4 100644 --- a/proto/dydxprotocol/ibcratelimit/limit_params.proto +++ b/proto/dydxprotocol/ratelimit/limit_params.proto @@ -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 { diff --git a/proto/dydxprotocol/ibcratelimit/query.proto b/proto/dydxprotocol/ratelimit/query.proto similarity index 85% rename from proto/dydxprotocol/ibcratelimit/query.proto rename to proto/dydxprotocol/ratelimit/query.proto index 23c36bb716..d50b9cd1ea 100644 --- a/proto/dydxprotocol/ibcratelimit/query.proto +++ b/proto/dydxprotocol/ratelimit/query.proto @@ -1,11 +1,11 @@ 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 { @@ -13,14 +13,14 @@ service Query { 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"; } } diff --git a/proto/dydxprotocol/ibcratelimit/tx.proto b/proto/dydxprotocol/ratelimit/tx.proto similarity index 92% rename from proto/dydxprotocol/ibcratelimit/tx.proto rename to proto/dydxprotocol/ratelimit/tx.proto index 31c2cd1566..87eb0ecf49 100644 --- a/proto/dydxprotocol/ibcratelimit/tx.proto +++ b/proto/dydxprotocol/ratelimit/tx.proto @@ -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 { diff --git a/protocol/app/app.go b/protocol/app/app.go index f4ee2f0939..dc12b1527b 100644 --- a/protocol/app/app.go +++ b/protocol/app/app.go @@ -143,18 +143,17 @@ import ( feetiersmodule "github.com/dydxprotocol/v4-chain/protocol/x/feetiers" feetiersmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/feetiers/keeper" feetiersmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/feetiers/types" - ibcratelimitmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/keeper" - ibcratelimitmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" perpetualsmodule "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals" perpetualsmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/keeper" perpetualsmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" pricesmodule "github.com/dydxprotocol/v4-chain/protocol/x/prices" pricesmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/prices/keeper" pricesmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" + ratelimitmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/keeper" + ratelimitmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types" rewardsmodule "github.com/dydxprotocol/v4-chain/protocol/x/rewards" rewardsmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/rewards/keeper" rewardsmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/rewards/types" - sendingmodule "github.com/dydxprotocol/v4-chain/protocol/x/sending" sendingmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/sending/keeper" sendingmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/sending/types" @@ -240,7 +239,7 @@ type App struct { IBCKeeper *ibckeeper.Keeper EvidenceKeeper evidencekeeper.Keeper TransferKeeper ibctransferkeeper.Keeper - IBCRateLimitKeeper ibcratelimitmodulekeeper.Keeper + RatelimitKeeper ratelimitmodulekeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper @@ -347,7 +346,7 @@ func New( distrtypes.StoreKey, slashingtypes.StoreKey, govtypes.StoreKey, paramstypes.StoreKey, consensusparamtypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, ibcexported.StoreKey, ibctransfertypes.StoreKey, - ibcratelimitmoduletypes.StoreKey, + ratelimitmoduletypes.StoreKey, evidencetypes.StoreKey, capabilitytypes.StoreKey, pricesmoduletypes.StoreKey, @@ -538,9 +537,9 @@ func New( transferModule := transfer.NewAppModule(app.TransferKeeper) transferIBCModule := transfer.NewIBCModule(app.TransferKeeper) - app.IBCRateLimitKeeper = *ibcratelimitmodulekeeper.NewKeeper( + app.RatelimitKeeper = *ratelimitmodulekeeper.NewKeeper( appCodec, - keys[ibcratelimitmoduletypes.StoreKey], + keys[ratelimitmoduletypes.StoreKey], // set the governance and delaymsg module accounts as the authority for conducting upgrades []string{ lib.GovModuleAddress.String(), @@ -548,7 +547,7 @@ func New( }, ) - // TODO(CORE-834): Add IBCRatelimitKeeper to the IBC transfer stack. + // TODO(CORE-834): Add ratelimitKeeper to the IBC transfer stack. // Create static IBC router, add transfer route, then set and seal it ibcRouter := ibcporttypes.NewRouter() @@ -989,7 +988,7 @@ func New( stakingtypes.ModuleName, ibcexported.ModuleName, ibctransfertypes.ModuleName, - ibcratelimitmoduletypes.ModuleName, + ratelimitmoduletypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, govtypes.ModuleName, @@ -1032,7 +1031,7 @@ func New( upgradetypes.ModuleName, ibcexported.ModuleName, ibctransfertypes.ModuleName, - ibcratelimitmoduletypes.ModuleName, + ratelimitmoduletypes.ModuleName, consensusparamtypes.ModuleName, pricesmoduletypes.ModuleName, assetsmoduletypes.ModuleName, @@ -1071,7 +1070,7 @@ func New( paramstypes.ModuleName, upgradetypes.ModuleName, ibctransfertypes.ModuleName, - ibcratelimitmoduletypes.ModuleName, + ratelimitmoduletypes.ModuleName, feegrant.ModuleName, consensusparamtypes.ModuleName, pricesmoduletypes.ModuleName, @@ -1107,7 +1106,7 @@ func New( paramstypes.ModuleName, upgradetypes.ModuleName, ibctransfertypes.ModuleName, - ibcratelimitmoduletypes.ModuleName, + ratelimitmoduletypes.ModuleName, feegrant.ModuleName, consensusparamtypes.ModuleName, pricesmoduletypes.ModuleName, diff --git a/protocol/x/ibcratelimit/keeper/msg_server_test.go b/protocol/x/ibcratelimit/keeper/msg_server_test.go deleted file mode 100644 index 364919e721..0000000000 --- a/protocol/x/ibcratelimit/keeper/msg_server_test.go +++ /dev/null @@ -1,3 +0,0 @@ -package keeper_test - -// TODO(CORE-825): Implement messages for `x/ibcratelimit` diff --git a/protocol/x/ibcratelimit/client/cli/query.go b/protocol/x/ratelimit/client/cli/query.go similarity index 75% rename from protocol/x/ibcratelimit/client/cli/query.go rename to protocol/x/ratelimit/client/cli/query.go index 5898fe2c05..1d041d7986 100644 --- a/protocol/x/ibcratelimit/client/cli/query.go +++ b/protocol/x/ratelimit/client/cli/query.go @@ -6,12 +6,12 @@ import ( "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" + "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types" ) // GetQueryCmd returns the cli query commands for this module func GetQueryCmd(queryRoute string) *cobra.Command { - // Group ibcratelimit queries under a subcommand + // Group ratelimit queries under a subcommand cmd := &cobra.Command{ Use: types.ModuleName, Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), @@ -20,7 +20,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } - // TODO(CORE-823): implement query for `x/ibcratelimit` + // TODO(CORE-823): implement query for `x/ratelimit` return cmd } diff --git a/protocol/x/ibcratelimit/client/cli/query_params.go b/protocol/x/ratelimit/client/cli/query_params.go similarity index 64% rename from protocol/x/ibcratelimit/client/cli/query_params.go rename to protocol/x/ratelimit/client/cli/query_params.go index 0c563a39d7..ba8ecb8d13 100644 --- a/protocol/x/ibcratelimit/client/cli/query_params.go +++ b/protocol/x/ratelimit/client/cli/query_params.go @@ -5,6 +5,6 @@ import ( ) func CmdQueryParams() *cobra.Command { - // TODO(CORE-823): implement query for `x/ibcratelimit` + // TODO(CORE-823): implement query for `x/ratelimit` return nil } diff --git a/protocol/x/ibcratelimit/client/cli/query_params_test.go b/protocol/x/ratelimit/client/cli/query_params_test.go similarity index 76% rename from protocol/x/ibcratelimit/client/cli/query_params_test.go rename to protocol/x/ratelimit/client/cli/query_params_test.go index aa8f70dd6e..3af5f67178 100644 --- a/protocol/x/ibcratelimit/client/cli/query_params_test.go +++ b/protocol/x/ratelimit/client/cli/query_params_test.go @@ -11,5 +11,5 @@ import ( var _ = strconv.IntSize func TestQueryParams(t *testing.T) { - // TODO(CORE-823): implement query for `x/ibcratelimit` + // TODO(CORE-823): implement query for `x/ratelimit` } diff --git a/protocol/x/ibcratelimit/client/cli/tx.go b/protocol/x/ratelimit/client/cli/tx.go similarity index 90% rename from protocol/x/ibcratelimit/client/cli/tx.go rename to protocol/x/ratelimit/client/cli/tx.go index 4711b9a0b3..e7c8f34580 100644 --- a/protocol/x/ibcratelimit/client/cli/tx.go +++ b/protocol/x/ratelimit/client/cli/tx.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" + "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types" ) var ( diff --git a/protocol/x/ibcratelimit/genesis.go b/protocol/x/ratelimit/genesis.go similarity index 75% rename from protocol/x/ibcratelimit/genesis.go rename to protocol/x/ratelimit/genesis.go index 0459d52e6b..2d13d636a9 100644 --- a/protocol/x/ibcratelimit/genesis.go +++ b/protocol/x/ratelimit/genesis.go @@ -1,9 +1,9 @@ -package ibcratelimit +package ratelimit import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/keeper" - "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" + "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/keeper" + "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types" ) // InitGenesis initializes the module's state from a provided genesis state. diff --git a/protocol/x/ibcratelimit/genesis_test.go b/protocol/x/ratelimit/genesis_test.go similarity index 79% rename from protocol/x/ibcratelimit/genesis_test.go rename to protocol/x/ratelimit/genesis_test.go index ce1b9e90f5..3ea88ca841 100644 --- a/protocol/x/ibcratelimit/genesis_test.go +++ b/protocol/x/ratelimit/genesis_test.go @@ -1,4 +1,4 @@ -package ibcratelimit_test +package ratelimit_test import ( "testing" diff --git a/protocol/x/ibcratelimit/keeper/grpc_query.go b/protocol/x/ratelimit/keeper/grpc_query.go similarity index 76% rename from protocol/x/ibcratelimit/keeper/grpc_query.go rename to protocol/x/ratelimit/keeper/grpc_query.go index cb8ce0af70..beb5d98f19 100644 --- a/protocol/x/ibcratelimit/keeper/grpc_query.go +++ b/protocol/x/ratelimit/keeper/grpc_query.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" + "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -14,13 +14,13 @@ func (k Keeper) ListLimitParams( ctx context.Context, req *types.ListLimitParamsRequest, ) (*types.ListLimitParamsResponse, error) { - // // TODO(CORE-823): implement query for `x/ibcratelimit` + // // TODO(CORE-823): implement query for `x/ratelimit` return nil, status.Errorf(codes.Unimplemented, "method ListLimitParams not implemented") } func (k Keeper) CapacityByDenom( ctx context.Context, req *types.QueryCapacityByDenomRequest, ) (*types.QueryCapacityByDenomResponse, error) { - // // TODO(CORE-823): implement query for `x/ibcratelimit` + // // TODO(CORE-823): implement query for `x/ratelimit` return nil, status.Errorf(codes.Unimplemented, "method CapacityByDenom not implemented") } diff --git a/protocol/x/ibcratelimit/keeper/grpc_query_test.go b/protocol/x/ratelimit/keeper/grpc_query_test.go similarity index 59% rename from protocol/x/ibcratelimit/keeper/grpc_query_test.go rename to protocol/x/ratelimit/keeper/grpc_query_test.go index 9e22027574..c3b87938c0 100644 --- a/protocol/x/ibcratelimit/keeper/grpc_query_test.go +++ b/protocol/x/ratelimit/keeper/grpc_query_test.go @@ -5,5 +5,5 @@ import ( ) func TestQueryParams(t *testing.T) { - // TODO(CORE-823): implement query for `x/ibcratelimit` + // TODO(CORE-823): implement query for `x/ratelimit` } diff --git a/protocol/x/ibcratelimit/keeper/keeper.go b/protocol/x/ratelimit/keeper/keeper.go similarity index 98% rename from protocol/x/ibcratelimit/keeper/keeper.go rename to protocol/x/ratelimit/keeper/keeper.go index 48f5b603a6..e25b0fdd0d 100644 --- a/protocol/x/ibcratelimit/keeper/keeper.go +++ b/protocol/x/ratelimit/keeper/keeper.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/dydxprotocol/v4-chain/protocol/dtypes" "github.com/dydxprotocol/v4-chain/protocol/lib" - "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" + "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types" ) var ( @@ -27,7 +27,7 @@ type ( cdc codec.BinaryCodec storeKey storetypes.StoreKey - // TODO(CORE-824): Implement `x/ibcratelimit` keeper + // TODO(CORE-824): Implement `x/ratelimit` keeper // the addresses capable of executing a MsgUpdateParams message. authorities map[string]struct{} diff --git a/protocol/x/ibcratelimit/keeper/keeper_test.go b/protocol/x/ratelimit/keeper/keeper_test.go similarity index 96% rename from protocol/x/ibcratelimit/keeper/keeper_test.go rename to protocol/x/ratelimit/keeper/keeper_test.go index 7defd197a6..6b63053fc5 100644 --- a/protocol/x/ibcratelimit/keeper/keeper_test.go +++ b/protocol/x/ratelimit/keeper/keeper_test.go @@ -5,7 +5,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/dtypes" testapp "github.com/dydxprotocol/v4-chain/protocol/testutil/app" - "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" + "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types" "github.com/stretchr/testify/require" ) @@ -16,7 +16,7 @@ const ( func TestSetGetDenomCapacity(t *testing.T) { tApp := testapp.NewTestAppBuilder(t).Build() ctx := tApp.InitChain() - k := tApp.App.IBCRateLimitKeeper + k := tApp.App.RatelimitKeeper capacityList := []dtypes.SerializableInt{ dtypes.NewInt(123_456_789), @@ -53,7 +53,7 @@ func TestSetGetDenomCapacity(t *testing.T) { func TestSetGetLimitParams_Success(t *testing.T) { tApp := testapp.NewTestAppBuilder(t).Build() ctx := tApp.InitChain() - k := tApp.App.IBCRateLimitKeeper + k := tApp.App.RatelimitKeeper limiters := []types.Limiter{ { diff --git a/protocol/x/ibcratelimit/keeper/msg_server.go b/protocol/x/ratelimit/keeper/msg_server.go similarity index 94% rename from protocol/x/ibcratelimit/keeper/msg_server.go rename to protocol/x/ratelimit/keeper/msg_server.go index 20f79281b6..bf6e4942e5 100644 --- a/protocol/x/ibcratelimit/keeper/msg_server.go +++ b/protocol/x/ratelimit/keeper/msg_server.go @@ -6,7 +6,7 @@ import ( errorsmod "cosmossdk.io/errors" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" + "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types" ) type msgServer struct { diff --git a/protocol/x/ratelimit/keeper/msg_server_test.go b/protocol/x/ratelimit/keeper/msg_server_test.go new file mode 100644 index 0000000000..9254b1f99d --- /dev/null +++ b/protocol/x/ratelimit/keeper/msg_server_test.go @@ -0,0 +1,3 @@ +package keeper_test + +// TODO(CORE-825): Implement messages for `x/ratelimit` diff --git a/protocol/x/ibcratelimit/module.go b/protocol/x/ratelimit/module.go similarity index 96% rename from protocol/x/ibcratelimit/module.go rename to protocol/x/ratelimit/module.go index 4af1472276..a58908bc0d 100644 --- a/protocol/x/ibcratelimit/module.go +++ b/protocol/x/ratelimit/module.go @@ -1,4 +1,4 @@ -package ibcratelimit +package ratelimit import ( "context" @@ -15,9 +15,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/client/cli" - "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/keeper" - "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" + "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/client/cli" + "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/keeper" + "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types" ) var ( diff --git a/protocol/x/ibcratelimit/module_simulation.go b/protocol/x/ratelimit/module_simulation.go similarity index 82% rename from protocol/x/ibcratelimit/module_simulation.go rename to protocol/x/ratelimit/module_simulation.go index 7f0fe7d628..f665f7334a 100644 --- a/protocol/x/ibcratelimit/module_simulation.go +++ b/protocol/x/ratelimit/module_simulation.go @@ -1,4 +1,4 @@ -package ibcratelimit +package ratelimit import ( "math/rand" @@ -9,14 +9,14 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" "github.com/dydxprotocol/v4-chain/protocol/testutil/sample" - ibcratelimitsimulation "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/simulation" - "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" + ratelimitsimulation "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/simulation" + "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types" ) // avoid unused import issue var ( _ = sample.AccAddress - _ = ibcratelimitsimulation.FindAccount + _ = ratelimitsimulation.FindAccount _ = simulation.MsgEntryKind _ = baseapp.Paramspace _ = rand.Rand{} @@ -28,8 +28,8 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { for i, acc := range simState.Accounts { accs[i] = acc.Address.String() } - ibcratelimitGenesis := types.GenesisState{} - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&ibcratelimitGenesis) + ratelimitGenesis := types.GenesisState{} + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&ratelimitGenesis) } // RegisterStoreDecoder registers a decoder. diff --git a/protocol/x/ibcratelimit/module_test.go b/protocol/x/ratelimit/module_test.go similarity index 62% rename from protocol/x/ibcratelimit/module_test.go rename to protocol/x/ratelimit/module_test.go index 3e9d8c136a..543d040be0 100644 --- a/protocol/x/ibcratelimit/module_test.go +++ b/protocol/x/ratelimit/module_test.go @@ -1,3 +1,3 @@ -package ibcratelimit_test +package ratelimit_test // TODO(CORE-824): Implement module tests diff --git a/protocol/x/ibcratelimit/simulation/helpers.go b/protocol/x/ratelimit/simulation/helpers.go similarity index 100% rename from protocol/x/ibcratelimit/simulation/helpers.go rename to protocol/x/ratelimit/simulation/helpers.go diff --git a/protocol/x/ibcratelimit/types/capacity.pb.go b/protocol/x/ratelimit/types/capacity.pb.go similarity index 83% rename from protocol/x/ibcratelimit/types/capacity.pb.go rename to protocol/x/ratelimit/types/capacity.pb.go index 297758e751..a1802911ee 100644 --- a/protocol/x/ibcratelimit/types/capacity.pb.go +++ b/protocol/x/ratelimit/types/capacity.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dydxprotocol/ibcratelimit/capacity.proto +// source: dydxprotocol/ratelimit/capacity.proto package types @@ -39,7 +39,7 @@ func (m *DenomCapacity) Reset() { *m = DenomCapacity{} } func (m *DenomCapacity) String() string { return proto.CompactTextString(m) } func (*DenomCapacity) ProtoMessage() {} func (*DenomCapacity) Descriptor() ([]byte, []int) { - return fileDescriptor_1790e9bf7712f620, []int{0} + return fileDescriptor_1d7e1de92ba2a318, []int{0} } func (m *DenomCapacity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -76,30 +76,30 @@ func (m *DenomCapacity) GetDenom() string { } func init() { - proto.RegisterType((*DenomCapacity)(nil), "dydxprotocol.ibcratelimit.DenomCapacity") + proto.RegisterType((*DenomCapacity)(nil), "dydxprotocol.ratelimit.DenomCapacity") } func init() { - proto.RegisterFile("dydxprotocol/ibcratelimit/capacity.proto", fileDescriptor_1790e9bf7712f620) + proto.RegisterFile("dydxprotocol/ratelimit/capacity.proto", fileDescriptor_1d7e1de92ba2a318) } -var fileDescriptor_1790e9bf7712f620 = []byte{ - // 236 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x48, 0xa9, 0x4c, 0xa9, - 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0xcf, 0x4c, 0x4a, 0x2e, 0x4a, 0x2c, 0x49, - 0xcd, 0xc9, 0xcc, 0xcd, 0x2c, 0xd1, 0x4f, 0x4e, 0x2c, 0x48, 0x4c, 0xce, 0x2c, 0xa9, 0xd4, 0x03, - 0x4b, 0x0b, 0x49, 0x22, 0xab, 0xd4, 0x43, 0x56, 0x29, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x96, - 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0x94, 0xa6, 0x30, 0x72, 0xf1, 0xba, 0xa4, 0xe6, 0xe5, 0xe7, 0x3a, - 0x43, 0x0d, 0x12, 0x12, 0xe1, 0x62, 0x4d, 0x01, 0x09, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, - 0x41, 0x38, 0x42, 0xb9, 0x5c, 0xbc, 0x30, 0xab, 0xe2, 0x73, 0x32, 0x8b, 0x4b, 0x24, 0x98, 0x14, - 0x98, 0x35, 0x78, 0x9c, 0x3c, 0x4e, 0xdc, 0x93, 0x67, 0xb8, 0x75, 0x4f, 0xde, 0x21, 0x3d, 0xb3, - 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xc5, 0xb1, 0x65, 0x26, 0xba, 0xc9, 0x19, - 0x89, 0x99, 0x79, 0xfa, 0x70, 0x91, 0x94, 0x92, 0xca, 0x82, 0xd4, 0x62, 0xbd, 0xe0, 0xd4, 0xa2, - 0xcc, 0xc4, 0x9c, 0xcc, 0xaa, 0xc4, 0xa4, 0x9c, 0x54, 0xcf, 0xbc, 0x92, 0x20, 0x1e, 0x98, 0xf1, - 0x3e, 0x99, 0xc5, 0x25, 0x4e, 0x11, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, - 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, - 0x65, 0x47, 0xbc, 0x4d, 0x15, 0xa8, 0x41, 0x05, 0xb6, 0x37, 0x89, 0x0d, 0x2c, 0x6d, 0x0c, 0x08, - 0x00, 0x00, 0xff, 0xff, 0xf2, 0x7f, 0xa7, 0xb7, 0x54, 0x01, 0x00, 0x00, +var fileDescriptor_1d7e1de92ba2a318 = []byte{ + // 233 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xa9, 0x4c, 0xa9, + 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0x2f, 0x4a, 0x2c, 0x49, 0xcd, 0xc9, 0xcc, + 0xcd, 0x2c, 0xd1, 0x4f, 0x4e, 0x2c, 0x48, 0x4c, 0xce, 0x2c, 0xa9, 0xd4, 0x03, 0xcb, 0x09, 0x89, + 0x21, 0x2b, 0xd3, 0x83, 0x2b, 0x93, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x8b, 0xeb, 0x83, 0x58, + 0x10, 0xd5, 0x4a, 0x53, 0x18, 0xb9, 0x78, 0x5d, 0x52, 0xf3, 0xf2, 0x73, 0x9d, 0xa1, 0xa6, 0x08, + 0x89, 0x70, 0xb1, 0xa6, 0x80, 0x04, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x20, 0x1c, 0xa1, + 0x5c, 0x2e, 0x5e, 0x98, 0x3d, 0xf1, 0x39, 0x99, 0xc5, 0x25, 0x12, 0x4c, 0x0a, 0xcc, 0x1a, 0x3c, + 0x4e, 0x1e, 0x27, 0xee, 0xc9, 0x33, 0xdc, 0xba, 0x27, 0xef, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, + 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x8f, 0xe2, 0xcc, 0x32, 0x13, 0xdd, 0xe4, 0x8c, 0xc4, 0xcc, 0x3c, + 0x7d, 0xb8, 0x48, 0x4a, 0x49, 0x65, 0x41, 0x6a, 0xb1, 0x5e, 0x70, 0x6a, 0x51, 0x66, 0x62, 0x4e, + 0x66, 0x55, 0x62, 0x52, 0x4e, 0xaa, 0x67, 0x5e, 0x49, 0x10, 0x0f, 0xcc, 0x78, 0x9f, 0xcc, 0xe2, + 0x12, 0xa7, 0xd0, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, + 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xb2, 0x26, 0xde, + 0xa6, 0x0a, 0xa4, 0x40, 0x02, 0x5b, 0x9a, 0xc4, 0x06, 0x96, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, + 0xff, 0x80, 0xee, 0x05, 0x92, 0x4b, 0x01, 0x00, 0x00, } func (m *DenomCapacity) Marshal() (dAtA []byte, err error) { diff --git a/protocol/x/ibcratelimit/types/codec.go b/protocol/x/ratelimit/types/codec.go similarity index 100% rename from protocol/x/ibcratelimit/types/codec.go rename to protocol/x/ratelimit/types/codec.go diff --git a/protocol/x/ibcratelimit/types/errors.go b/protocol/x/ratelimit/types/errors.go similarity index 88% rename from protocol/x/ibcratelimit/types/errors.go rename to protocol/x/ratelimit/types/errors.go index 839fb65533..8c02881fc4 100644 --- a/protocol/x/ibcratelimit/types/errors.go +++ b/protocol/x/ratelimit/types/errors.go @@ -4,7 +4,7 @@ package types import errorsmod "cosmossdk.io/errors" -// x/ibcratelimit module sentinel errors +// x/ratelimit module sentinel errors var ( ErrInvalidAuthority = errorsmod.Register( ModuleName, diff --git a/protocol/x/ibcratelimit/types/expected_keepers.go b/protocol/x/ratelimit/types/expected_keepers.go similarity index 100% rename from protocol/x/ibcratelimit/types/expected_keepers.go rename to protocol/x/ratelimit/types/expected_keepers.go diff --git a/protocol/x/ibcratelimit/types/genesis.go b/protocol/x/ratelimit/types/genesis.go similarity index 100% rename from protocol/x/ibcratelimit/types/genesis.go rename to protocol/x/ratelimit/types/genesis.go diff --git a/protocol/x/ibcratelimit/types/genesis.pb.go b/protocol/x/ratelimit/types/genesis.pb.go similarity index 80% rename from protocol/x/ibcratelimit/types/genesis.pb.go rename to protocol/x/ratelimit/types/genesis.pb.go index 92f4d23e02..f6914b9886 100644 --- a/protocol/x/ibcratelimit/types/genesis.pb.go +++ b/protocol/x/ratelimit/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dydxprotocol/ibcratelimit/genesis.proto +// source: dydxprotocol/ratelimit/genesis.proto package types @@ -23,7 +23,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// GenesisState defines the ibcratelimit module's genesis state. +// GenesisState defines the ratelimit module's genesis state. type GenesisState struct { // limit_params_list defines the list of `LimitParams` at genesis. LimitParamsList []LimitParams `protobuf:"bytes,1,rep,name=limit_params_list,json=limitParamsList,proto3" json:"limit_params_list"` @@ -33,7 +33,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_fa1ff5707cde3652, []int{0} + return fileDescriptor_2a8e01e067b5f0e8, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -70,29 +70,29 @@ func (m *GenesisState) GetLimitParamsList() []LimitParams { } func init() { - proto.RegisterType((*GenesisState)(nil), "dydxprotocol.ibcratelimit.GenesisState") + proto.RegisterType((*GenesisState)(nil), "dydxprotocol.ratelimit.GenesisState") } func init() { - proto.RegisterFile("dydxprotocol/ibcratelimit/genesis.proto", fileDescriptor_fa1ff5707cde3652) + proto.RegisterFile("dydxprotocol/ratelimit/genesis.proto", fileDescriptor_2a8e01e067b5f0e8) } -var fileDescriptor_fa1ff5707cde3652 = []byte{ - // 219 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4f, 0xa9, 0x4c, 0xa9, - 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0xcf, 0x4c, 0x4a, 0x2e, 0x4a, 0x2c, 0x49, - 0xcd, 0xc9, 0xcc, 0xcd, 0x2c, 0xd1, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x03, 0xcb, - 0x0a, 0x49, 0x22, 0x2b, 0xd4, 0x43, 0x56, 0x28, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x96, 0xd2, - 0x07, 0xb1, 0x20, 0x1a, 0xa4, 0x74, 0x70, 0x9b, 0x0c, 0x26, 0xe3, 0x0b, 0x12, 0x8b, 0x12, 0x73, - 0xa1, 0xc6, 0x2b, 0x65, 0x70, 0xf1, 0xb8, 0x43, 0xec, 0x0b, 0x2e, 0x49, 0x2c, 0x49, 0x15, 0x8a, - 0xe0, 0x12, 0x44, 0x56, 0x15, 0x9f, 0x93, 0x59, 0x5c, 0x22, 0xc1, 0xa8, 0xc0, 0xac, 0xc1, 0x6d, - 0xa4, 0xa6, 0x87, 0xd3, 0x29, 0x7a, 0x3e, 0x20, 0x32, 0x00, 0xac, 0xc5, 0x89, 0xe5, 0xc4, 0x3d, - 0x79, 0x86, 0x20, 0xfe, 0x1c, 0x84, 0x90, 0x4f, 0x66, 0x71, 0x89, 0x53, 0xc4, 0x89, 0x47, 0x72, - 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, - 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xd9, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, - 0xe7, 0xe7, 0xea, 0xa3, 0x38, 0xbe, 0xcc, 0x44, 0x37, 0x39, 0x23, 0x31, 0x33, 0x4f, 0x1f, 0x2e, - 0x52, 0x81, 0xea, 0xa1, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xb4, 0x31, 0x20, 0x00, - 0x00, 0xff, 0xff, 0xff, 0x02, 0xf6, 0x8a, 0x54, 0x01, 0x00, 0x00, +var fileDescriptor_2a8e01e067b5f0e8 = []byte{ + // 216 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xa9, 0x4c, 0xa9, + 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0x2f, 0x4a, 0x2c, 0x49, 0xcd, 0xc9, 0xcc, + 0xcd, 0x2c, 0xd1, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x03, 0x4b, 0x09, 0x89, 0x21, + 0xab, 0xd2, 0x83, 0xab, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x8b, 0xeb, 0x83, 0x58, 0x10, + 0xd5, 0x52, 0x9a, 0x38, 0xcc, 0x04, 0x93, 0xf1, 0x05, 0x89, 0x45, 0x89, 0xb9, 0x50, 0x83, 0x95, + 0x52, 0xb9, 0x78, 0xdc, 0x21, 0x36, 0x05, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x85, 0x72, 0x09, 0x22, + 0xab, 0x8a, 0xcf, 0xc9, 0x2c, 0x2e, 0x91, 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, 0x52, 0xd6, 0xc3, + 0xee, 0x08, 0x3d, 0x1f, 0x10, 0x19, 0x00, 0x56, 0xef, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, + 0x7f, 0x0e, 0x42, 0xc8, 0x27, 0xb3, 0xb8, 0xc4, 0x29, 0xf4, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, + 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, + 0x8f, 0xe5, 0x18, 0xa2, 0xac, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, + 0x51, 0x9c, 0x5d, 0x66, 0xa2, 0x9b, 0x9c, 0x91, 0x98, 0x99, 0xa7, 0x0f, 0x17, 0xa9, 0x40, 0xf2, + 0x4a, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x58, 0xce, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, + 0x9f, 0x3b, 0x87, 0x8d, 0x45, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/protocol/x/ibcratelimit/types/genesis_test.go b/protocol/x/ratelimit/types/genesis_test.go similarity index 100% rename from protocol/x/ibcratelimit/types/genesis_test.go rename to protocol/x/ratelimit/types/genesis_test.go diff --git a/protocol/x/ibcratelimit/types/keys.go b/protocol/x/ratelimit/types/keys.go similarity index 80% rename from protocol/x/ibcratelimit/types/keys.go rename to protocol/x/ratelimit/types/keys.go index 499ee30ebf..710c705c02 100644 --- a/protocol/x/ibcratelimit/types/keys.go +++ b/protocol/x/ratelimit/types/keys.go @@ -3,7 +3,7 @@ package types // Module name and store keys const ( // ModuleName defines the module name - // Use `ratelimit` instead of `ibcratelimit` to prevent potential key space conflicts with the IBC module. + // Use `ratelimit` instead of `ratelimit` to prevent potential key space conflicts with the IBC module. ModuleName = "ratelimit" // StoreKey defines the primary module store key diff --git a/protocol/x/ibcratelimit/types/keys_test.go b/protocol/x/ratelimit/types/keys_test.go similarity index 53% rename from protocol/x/ibcratelimit/types/keys_test.go rename to protocol/x/ratelimit/types/keys_test.go index 468abb6b17..f5acc7ee7f 100644 --- a/protocol/x/ibcratelimit/types/keys_test.go +++ b/protocol/x/ratelimit/types/keys_test.go @@ -3,13 +3,13 @@ package types_test import ( "testing" - "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" + "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types" "github.com/stretchr/testify/require" ) func TestModuleKeys(t *testing.T) { - require.Equal(t, "ibcratelimit", types.ModuleName) - require.Equal(t, "ibcratelimit", types.StoreKey) + require.Equal(t, "ratelimit", types.ModuleName) + require.Equal(t, "ratelimit", types.StoreKey) } func TestStateKeys(t *testing.T) { diff --git a/protocol/x/ibcratelimit/types/limit_params.pb.go b/protocol/x/ratelimit/types/limit_params.pb.go similarity index 85% rename from protocol/x/ibcratelimit/types/limit_params.pb.go rename to protocol/x/ratelimit/types/limit_params.pb.go index b77fb539ad..4dfe8900d6 100644 --- a/protocol/x/ibcratelimit/types/limit_params.pb.go +++ b/protocol/x/ratelimit/types/limit_params.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dydxprotocol/ibcratelimit/limit_params.proto +// source: dydxprotocol/ratelimit/limit_params.proto package types @@ -38,7 +38,7 @@ func (m *LimitParams) Reset() { *m = LimitParams{} } func (m *LimitParams) String() string { return proto.CompactTextString(m) } func (*LimitParams) ProtoMessage() {} func (*LimitParams) Descriptor() ([]byte, []int) { - return fileDescriptor_9b1618a221d924d8, []int{0} + return fileDescriptor_b795558e1de1468a, []int{0} } func (m *LimitParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -100,7 +100,7 @@ func (m *Limiter) Reset() { *m = Limiter{} } func (m *Limiter) String() string { return proto.CompactTextString(m) } func (*Limiter) ProtoMessage() {} func (*Limiter) Descriptor() ([]byte, []int) { - return fileDescriptor_9b1618a221d924d8, []int{1} + return fileDescriptor_b795558e1de1468a, []int{1} } func (m *Limiter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -144,37 +144,37 @@ func (m *Limiter) GetBaselineTvlPpm() uint32 { } func init() { - proto.RegisterType((*LimitParams)(nil), "dydxprotocol.ibcratelimit.LimitParams") - proto.RegisterType((*Limiter)(nil), "dydxprotocol.ibcratelimit.Limiter") + proto.RegisterType((*LimitParams)(nil), "dydxprotocol.ratelimit.LimitParams") + proto.RegisterType((*Limiter)(nil), "dydxprotocol.ratelimit.Limiter") } func init() { - proto.RegisterFile("dydxprotocol/ibcratelimit/limit_params.proto", fileDescriptor_9b1618a221d924d8) + proto.RegisterFile("dydxprotocol/ratelimit/limit_params.proto", fileDescriptor_b795558e1de1468a) } -var fileDescriptor_9b1618a221d924d8 = []byte{ - // 332 bytes of a gzipped FileDescriptorProto +var fileDescriptor_b795558e1de1468a = []byte{ + // 329 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0x4f, 0x4b, 0xc3, 0x30, - 0x1c, 0x6d, 0xb6, 0xf9, 0x67, 0x99, 0xff, 0x28, 0x3b, 0x54, 0xc1, 0xae, 0xec, 0xd4, 0x83, 0xb6, - 0xa0, 0x9e, 0x45, 0x86, 0x07, 0x85, 0x09, 0xa3, 0xf3, 0x20, 0x5e, 0x4a, 0xda, 0x86, 0xed, 0x07, - 0x49, 0x13, 0xda, 0x6c, 0x6c, 0x7e, 0x0a, 0xbf, 0x95, 0x3b, 0xee, 0x28, 0x1e, 0x86, 0x6c, 0x5f, - 0x44, 0x96, 0xba, 0xb1, 0x1d, 0x04, 0x2f, 0x21, 0x79, 0xef, 0xfd, 0xde, 0x7b, 0xe4, 0x87, 0x2f, - 0x92, 0x71, 0x32, 0x92, 0x99, 0x50, 0x22, 0x16, 0xcc, 0x87, 0x28, 0xce, 0x88, 0xa2, 0x0c, 0x38, - 0x28, 0x5f, 0x9f, 0xa1, 0x24, 0x19, 0xe1, 0xb9, 0xa7, 0x25, 0xe6, 0xe9, 0xa6, 0xda, 0xdb, 0x54, - 0x9f, 0xd5, 0x7b, 0xa2, 0x27, 0x34, 0xe5, 0x2f, 0x6f, 0xc5, 0x40, 0x13, 0x70, 0xad, 0xbd, 0xa4, - 0x3b, 0xda, 0xc5, 0xac, 0xe3, 0x9d, 0x84, 0xa6, 0x82, 0x5b, 0xc8, 0x41, 0x6e, 0x35, 0x28, 0x1e, - 0xe6, 0x3d, 0xde, 0xd7, 0x1e, 0x34, 0xcb, 0xad, 0x92, 0x53, 0x76, 0x6b, 0x57, 0x4d, 0xef, 0xcf, - 0x20, 0xaf, 0x5d, 0x48, 0x5b, 0x95, 0xc9, 0xac, 0x61, 0x04, 0xeb, 0xc9, 0xe6, 0x07, 0xc2, 0x7b, - 0xbf, 0x9c, 0x79, 0x8e, 0xb1, 0xa4, 0x19, 0x88, 0x24, 0xcc, 0x69, 0x6c, 0x95, 0x1c, 0xe4, 0x1e, - 0x06, 0xd5, 0x02, 0xe9, 0xd2, 0xd8, 0xcc, 0xf1, 0x49, 0x44, 0x72, 0xca, 0x20, 0xa5, 0x21, 0x87, - 0x14, 0xf8, 0x80, 0x5b, 0x65, 0x07, 0xb9, 0x07, 0xad, 0x87,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x8d, 0x85, 0x60, 0x4e, 0xc5, + 0x34, 0x3b, 0x58, 0xe1, 0x8f, 0x43, 0xda, 0x11, 0xac, 0xf5, 0x34, 0x99, 0xbb, 0x60, 0x3a, 0x77, + 0xc1, 0xd7, 0xdc, 0x05, 0x6f, 0x0b, 0xd7, 0x9a, 0x2e, 0x5c, 0xeb, 0x63, 0xe1, 0x5a, 0xcf, 0xd7, + 0xff, 0xaf, 0x35, 0xda, 0xd8, 0xa1, 0x69, 0x98, 0x6c, 0x1b, 0xee, 0xf2, 0x3b, 0x00, 0x00, 0xff, + 0xff, 0xd1, 0xaf, 0x8a, 0x2d, 0xea, 0x01, 0x00, 0x00, } func (m *LimitParams) Marshal() (dAtA []byte, err error) { diff --git a/protocol/x/ibcratelimit/types/params.go b/protocol/x/ratelimit/types/params.go similarity index 100% rename from protocol/x/ibcratelimit/types/params.go rename to protocol/x/ratelimit/types/params.go diff --git a/protocol/x/ibcratelimit/types/query.pb.go b/protocol/x/ratelimit/types/query.pb.go similarity index 87% rename from protocol/x/ibcratelimit/types/query.pb.go rename to protocol/x/ratelimit/types/query.pb.go index e9f2415f3c..4a8a939b04 100644 --- a/protocol/x/ibcratelimit/types/query.pb.go +++ b/protocol/x/ratelimit/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dydxprotocol/ibcratelimit/query.proto +// source: dydxprotocol/ratelimit/query.proto package types @@ -38,7 +38,7 @@ func (m *ListLimitParamsRequest) Reset() { *m = ListLimitParamsRequest{} func (m *ListLimitParamsRequest) String() string { return proto.CompactTextString(m) } func (*ListLimitParamsRequest) ProtoMessage() {} func (*ListLimitParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e49fb82b9f3fb8a9, []int{0} + return fileDescriptor_f2e2dd1cb27aa65a, []int{0} } func (m *ListLimitParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -76,7 +76,7 @@ func (m *ListLimitParamsResponse) Reset() { *m = ListLimitParamsResponse func (m *ListLimitParamsResponse) String() string { return proto.CompactTextString(m) } func (*ListLimitParamsResponse) ProtoMessage() {} func (*ListLimitParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e49fb82b9f3fb8a9, []int{1} + return fileDescriptor_f2e2dd1cb27aa65a, []int{1} } func (m *ListLimitParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -122,7 +122,7 @@ func (m *QueryCapacityByDenomRequest) Reset() { *m = QueryCapacityByDeno func (m *QueryCapacityByDenomRequest) String() string { return proto.CompactTextString(m) } func (*QueryCapacityByDenomRequest) ProtoMessage() {} func (*QueryCapacityByDenomRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e49fb82b9f3fb8a9, []int{2} + return fileDescriptor_f2e2dd1cb27aa65a, []int{2} } func (m *QueryCapacityByDenomRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -168,7 +168,7 @@ func (m *CapacityResult) Reset() { *m = CapacityResult{} } func (m *CapacityResult) String() string { return proto.CompactTextString(m) } func (*CapacityResult) ProtoMessage() {} func (*CapacityResult) Descriptor() ([]byte, []int) { - return fileDescriptor_e49fb82b9f3fb8a9, []int{3} + return fileDescriptor_f2e2dd1cb27aa65a, []int{3} } func (m *CapacityResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -214,7 +214,7 @@ func (m *QueryCapacityByDenomResponse) Reset() { *m = QueryCapacityByDen func (m *QueryCapacityByDenomResponse) String() string { return proto.CompactTextString(m) } func (*QueryCapacityByDenomResponse) ProtoMessage() {} func (*QueryCapacityByDenomResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e49fb82b9f3fb8a9, []int{4} + return fileDescriptor_f2e2dd1cb27aa65a, []int{4} } func (m *QueryCapacityByDenomResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -251,49 +251,49 @@ func (m *QueryCapacityByDenomResponse) GetResults() []*CapacityResult { } func init() { - proto.RegisterType((*ListLimitParamsRequest)(nil), "dydxprotocol.ibcratelimit.ListLimitParamsRequest") - proto.RegisterType((*ListLimitParamsResponse)(nil), "dydxprotocol.ibcratelimit.ListLimitParamsResponse") - proto.RegisterType((*QueryCapacityByDenomRequest)(nil), "dydxprotocol.ibcratelimit.QueryCapacityByDenomRequest") - proto.RegisterType((*CapacityResult)(nil), "dydxprotocol.ibcratelimit.CapacityResult") - proto.RegisterType((*QueryCapacityByDenomResponse)(nil), "dydxprotocol.ibcratelimit.QueryCapacityByDenomResponse") + proto.RegisterType((*ListLimitParamsRequest)(nil), "dydxprotocol.ratelimit.ListLimitParamsRequest") + proto.RegisterType((*ListLimitParamsResponse)(nil), "dydxprotocol.ratelimit.ListLimitParamsResponse") + proto.RegisterType((*QueryCapacityByDenomRequest)(nil), "dydxprotocol.ratelimit.QueryCapacityByDenomRequest") + proto.RegisterType((*CapacityResult)(nil), "dydxprotocol.ratelimit.CapacityResult") + proto.RegisterType((*QueryCapacityByDenomResponse)(nil), "dydxprotocol.ratelimit.QueryCapacityByDenomResponse") } func init() { - proto.RegisterFile("dydxprotocol/ibcratelimit/query.proto", fileDescriptor_e49fb82b9f3fb8a9) + proto.RegisterFile("dydxprotocol/ratelimit/query.proto", fileDescriptor_f2e2dd1cb27aa65a) } -var fileDescriptor_e49fb82b9f3fb8a9 = []byte{ - // 478 bytes of a gzipped FileDescriptorProto +var fileDescriptor_f2e2dd1cb27aa65a = []byte{ + // 475 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x4d, 0x6b, 0xd4, 0x40, - 0x18, 0xde, 0x59, 0xa9, 0xda, 0xf1, 0x63, 0x71, 0x28, 0xba, 0xae, 0x35, 0x5d, 0x02, 0xca, 0x0a, - 0x9a, 0xa1, 0x5b, 0xb1, 0x37, 0x91, 0xad, 0x07, 0x85, 0x1e, 0x34, 0xbd, 0x88, 0x97, 0x30, 0x99, - 0x0c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14, 0xde, 0x67, 0x29, + 0xa7, 0x82, 0x7f, 0xa0, 0x9e, 0x60, 0xcf, 0x63, 0xed, 0xcc, 0x2b, 0xdb, 0x6f, 0xe1, 0xd6, 0xea, + 0x65, 0x2a, 0xf5, 0x76, 0xe1, 0x95, 0xd4, 0x8c, 0xab, 0x2a, 0xcd, 0xee, 0x37, 0x69, 0xb6, 0xb8, + 0x9d, 0x33, 0x4b, 0xdb, 0xf9, 0xd3, 0x86, 0x6b, 0xa6, 0x05, 0xfa, 0x0a, 0x60, 0x67, 0xe9, 0x4a, + 0x08, 0x37, 0x9f, 0x60, 0xd5, 0xa1, 0x7b, 0xe4, 0xdc, 0xfc, 0x72, 0x01, 0x7b, 0xf4, 0xf1, 0xfb, + 0xef, 0xcf, 0x6d, 0x8c, 0x1e, 0x2e, 0x4b, 0xb5, 0x60, 0x35, 0xa5, 0xdd, 0xba, 0x49, 0xd0, 0x37, + 0x00, 0x3b, 0x4b, 0x92, 0xa0, 0x61, 0x53, 0xeb, 0x33, 0xdc, 0xd0, 0x1b, 0x5d, 0x2c, 0xe9, 0x02, + 0x43, 0xcf, 0x4e, 0xe8, 0x7a, 0xb9, 0x6b, 0x3c, 0x36, 0x7e, 0x7d, 0x3c, 0xb1, 0xc0, 0xc9, 0xc4, + 0x02, 0xbf, 0x26, 0x16, 0xf8, 0x34, 0xb5, 0x5a, 0x27, 0x53, 0xab, 0xf5, 0x63, 0x6a, 0xb5, 0xde, + 0x3c, 0x3e, 0xbf, 0x63, 0x8e, 0x6a, 0x2d, 0x8c, 0x79, 0xbc, 0xcb, 0x06, 0x1b, 0xfe, 0x0d, 0x00, + 0x00, 0xff, 0xff, 0xe9, 0xc9, 0xf9, 0x71, 0x19, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -324,7 +324,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) ListLimitParams(ctx context.Context, in *ListLimitParamsRequest, opts ...grpc.CallOption) (*ListLimitParamsResponse, error) { out := new(ListLimitParamsResponse) - err := c.cc.Invoke(ctx, "/dydxprotocol.ibcratelimit.Query/ListLimitParams", in, out, opts...) + err := c.cc.Invoke(ctx, "/dydxprotocol.ratelimit.Query/ListLimitParams", in, out, opts...) if err != nil { return nil, err } @@ -333,7 +333,7 @@ func (c *queryClient) ListLimitParams(ctx context.Context, in *ListLimitParamsRe func (c *queryClient) CapacityByDenom(ctx context.Context, in *QueryCapacityByDenomRequest, opts ...grpc.CallOption) (*QueryCapacityByDenomResponse, error) { out := new(QueryCapacityByDenomResponse) - err := c.cc.Invoke(ctx, "/dydxprotocol.ibcratelimit.Query/CapacityByDenom", in, out, opts...) + err := c.cc.Invoke(ctx, "/dydxprotocol.ratelimit.Query/CapacityByDenom", in, out, opts...) if err != nil { return nil, err } @@ -373,7 +373,7 @@ func _Query_ListLimitParams_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/dydxprotocol.ibcratelimit.Query/ListLimitParams", + FullMethod: "/dydxprotocol.ratelimit.Query/ListLimitParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ListLimitParams(ctx, req.(*ListLimitParamsRequest)) @@ -391,7 +391,7 @@ func _Query_CapacityByDenom_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/dydxprotocol.ibcratelimit.Query/CapacityByDenom", + FullMethod: "/dydxprotocol.ratelimit.Query/CapacityByDenom", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).CapacityByDenom(ctx, req.(*QueryCapacityByDenomRequest)) @@ -400,7 +400,7 @@ func _Query_CapacityByDenom_Handler(srv interface{}, ctx context.Context, dec fu } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "dydxprotocol.ibcratelimit.Query", + ServiceName: "dydxprotocol.ratelimit.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -413,7 +413,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "dydxprotocol/ibcratelimit/query.proto", + Metadata: "dydxprotocol/ratelimit/query.proto", } func (m *ListLimitParamsRequest) Marshal() (dAtA []byte, err error) { diff --git a/protocol/x/ibcratelimit/types/query.pb.gw.go b/protocol/x/ratelimit/types/query.pb.gw.go similarity index 97% rename from protocol/x/ibcratelimit/types/query.pb.gw.go rename to protocol/x/ratelimit/types/query.pb.gw.go index 40147b12db..d94c451c14 100644 --- a/protocol/x/ibcratelimit/types/query.pb.gw.go +++ b/protocol/x/ratelimit/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: dydxprotocol/ibcratelimit/query.proto +// source: dydxprotocol/ratelimit/query.proto /* Package types is a reverse proxy. @@ -224,9 +224,9 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_ListLimitParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dydxprotocol", "v4", "ibcratelimit", "list_limit_params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ListLimitParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dydxprotocol", "v4", "ratelimit", "list_limit_params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_CapacityByDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dydxprotocol", "v4", "ibcratelimit", "capacity_by_denom"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_CapacityByDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dydxprotocol", "v4", "ratelimit", "capacity_by_denom"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/protocol/x/ibcratelimit/types/tx.go b/protocol/x/ratelimit/types/tx.go similarity index 100% rename from protocol/x/ibcratelimit/types/tx.go rename to protocol/x/ratelimit/types/tx.go diff --git a/protocol/x/ibcratelimit/types/tx.pb.go b/protocol/x/ratelimit/types/tx.pb.go similarity index 88% rename from protocol/x/ibcratelimit/types/tx.pb.go rename to protocol/x/ratelimit/types/tx.pb.go index 44e6324d94..37a79bb109 100644 --- a/protocol/x/ibcratelimit/types/tx.pb.go +++ b/protocol/x/ratelimit/types/tx.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dydxprotocol/ibcratelimit/tx.proto +// source: dydxprotocol/ratelimit/tx.proto package types @@ -39,7 +39,7 @@ func (m *MsgSetLimitParams) Reset() { *m = MsgSetLimitParams{} } func (m *MsgSetLimitParams) String() string { return proto.CompactTextString(m) } func (*MsgSetLimitParams) ProtoMessage() {} func (*MsgSetLimitParams) Descriptor() ([]byte, []int) { - return fileDescriptor_a419c53765e30c3b, []int{0} + return fileDescriptor_3c12b4609ad9be85, []int{0} } func (m *MsgSetLimitParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -90,7 +90,7 @@ func (m *MsgSetLimitParamsResponse) Reset() { *m = MsgSetLimitParamsResp func (m *MsgSetLimitParamsResponse) String() string { return proto.CompactTextString(m) } func (*MsgSetLimitParamsResponse) ProtoMessage() {} func (*MsgSetLimitParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a419c53765e30c3b, []int{1} + return fileDescriptor_3c12b4609ad9be85, []int{1} } func (m *MsgSetLimitParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -130,7 +130,7 @@ func (m *MsgDeleteLimitParams) Reset() { *m = MsgDeleteLimitParams{} } func (m *MsgDeleteLimitParams) String() string { return proto.CompactTextString(m) } func (*MsgDeleteLimitParams) ProtoMessage() {} func (*MsgDeleteLimitParams) Descriptor() ([]byte, []int) { - return fileDescriptor_a419c53765e30c3b, []int{2} + return fileDescriptor_3c12b4609ad9be85, []int{2} } func (m *MsgDeleteLimitParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -181,7 +181,7 @@ func (m *MsgDeleteLimitParamsResponse) Reset() { *m = MsgDeleteLimitPara func (m *MsgDeleteLimitParamsResponse) String() string { return proto.CompactTextString(m) } func (*MsgDeleteLimitParamsResponse) ProtoMessage() {} func (*MsgDeleteLimitParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a419c53765e30c3b, []int{3} + return fileDescriptor_3c12b4609ad9be85, []int{3} } func (m *MsgDeleteLimitParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -211,39 +211,37 @@ func (m *MsgDeleteLimitParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDeleteLimitParamsResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgSetLimitParams)(nil), "dydxprotocol.ibcratelimit.MsgSetLimitParams") - proto.RegisterType((*MsgSetLimitParamsResponse)(nil), "dydxprotocol.ibcratelimit.MsgSetLimitParamsResponse") - proto.RegisterType((*MsgDeleteLimitParams)(nil), "dydxprotocol.ibcratelimit.MsgDeleteLimitParams") - proto.RegisterType((*MsgDeleteLimitParamsResponse)(nil), "dydxprotocol.ibcratelimit.MsgDeleteLimitParamsResponse") -} - -func init() { - proto.RegisterFile("dydxprotocol/ibcratelimit/tx.proto", fileDescriptor_a419c53765e30c3b) -} - -var fileDescriptor_a419c53765e30c3b = []byte{ - // 336 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xa9, 0x4c, 0xa9, - 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0xcf, 0x4c, 0x4a, 0x2e, 0x4a, 0x2c, 0x49, - 0xcd, 0xc9, 0xcc, 0xcd, 0x2c, 0xd1, 0x2f, 0xa9, 0xd0, 0x03, 0x4b, 0x08, 0x49, 0x22, 0xab, 0xd1, - 0x43, 0x56, 0x23, 0x25, 0x9e, 0x9c, 0x5f, 0x9c, 0x9b, 0x5f, 0xac, 0x9f, 0x5b, 0x9c, 0xae, 0x5f, - 0x66, 0x08, 0xa2, 0x20, 0x7a, 0xa4, 0x74, 0x70, 0x9b, 0x0b, 0x26, 0xe3, 0x0b, 0x12, 0x8b, 0x12, - 0x73, 0x8b, 0x21, 0xaa, 0x95, 0x7a, 0x18, 0xb9, 0x04, 0x7d, 0x8b, 0xd3, 0x83, 0x53, 0x4b, 0x7c, - 0x40, 0x92, 0x01, 0x60, 0x39, 0x21, 0x19, 0x2e, 0xce, 0xc4, 0xd2, 0x92, 0x8c, 0xfc, 0xa2, 0xcc, - 0x92, 0x4a, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x84, 0x80, 0x90, 0x27, 0x17, 0x0f, 0xb2, - 0x49, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x6a, 0x7a, 0x38, 0x1d, 0xab, 0x87, 0x64, 0x76, - 0x10, 0x77, 0x0e, 0x82, 0x63, 0xc5, 0xd7, 0xf4, 0x7c, 0x83, 0x16, 0xc2, 0x68, 0x25, 0x69, 0x2e, - 0x49, 0x0c, 0xd7, 0x04, 0xa5, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x2a, 0x45, 0x71, 0x89, 0xf8, - 0x16, 0xa7, 0xbb, 0xa4, 0xe6, 0xa4, 0x96, 0xa4, 0x12, 0xef, 0x5a, 0x11, 0x2e, 0xd6, 0x94, 0xd4, - 0xbc, 0xfc, 0x5c, 0xb0, 0x33, 0x39, 0x83, 0x20, 0x1c, 0x0c, 0x8b, 0xe5, 0xb8, 0x64, 0xb0, 0x99, - 0x0d, 0xb3, 0xdb, 0xe8, 0x17, 0x23, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x50, 0x09, 0x17, 0x1f, 0x5a, - 0x58, 0xe9, 0xe0, 0xf1, 0x37, 0x86, 0x5f, 0xa4, 0x4c, 0x48, 0x51, 0x0d, 0xb3, 0x5d, 0xa8, 0x96, - 0x4b, 0x10, 0xd3, 0xdb, 0xfa, 0xf8, 0x8d, 0xc2, 0xd0, 0x20, 0x65, 0x4e, 0xa2, 0x06, 0x98, 0xf5, - 0x4e, 0x11, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, - 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x97, 0x9e, 0x59, - 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x8f, 0x92, 0xee, 0xca, 0x4c, 0x74, 0x93, 0x33, - 0x12, 0x33, 0xf3, 0xf4, 0xe1, 0x22, 0x15, 0x68, 0x69, 0xbc, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, - 0x2c, 0x6d, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x57, 0x42, 0x04, 0xf6, 0x0d, 0x03, 0x00, 0x00, + proto.RegisterType((*MsgSetLimitParams)(nil), "dydxprotocol.ratelimit.MsgSetLimitParams") + proto.RegisterType((*MsgSetLimitParamsResponse)(nil), "dydxprotocol.ratelimit.MsgSetLimitParamsResponse") + proto.RegisterType((*MsgDeleteLimitParams)(nil), "dydxprotocol.ratelimit.MsgDeleteLimitParams") + proto.RegisterType((*MsgDeleteLimitParamsResponse)(nil), "dydxprotocol.ratelimit.MsgDeleteLimitParamsResponse") +} + +func init() { proto.RegisterFile("dydxprotocol/ratelimit/tx.proto", fileDescriptor_3c12b4609ad9be85) } + +var fileDescriptor_3c12b4609ad9be85 = []byte{ + // 333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 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 0x9c, 0x41, 0x10, 0x0e, 0x86, 0xc5, 0x72, 0x5c, 0x32, 0xd8, 0xcc, 0x86, 0xd9, 0x6d, + 0xf4, 0x8e, 0x91, 0x8b, 0xd9, 0xb7, 0x38, 0x5d, 0x28, 0x8f, 0x8b, 0x0f, 0x2d, 0xa0, 0x34, 0x71, + 0x79, 0x1a, 0xc3, 0x23, 0x52, 0x86, 0x44, 0x2b, 0x85, 0xd9, 0x2b, 0x54, 0xce, 0x25, 0x88, 0xe9, + 0x61, 0x1d, 0x3c, 0xe6, 0x60, 0xa8, 0x96, 0x32, 0x21, 0x45, 0x35, 0xcc, 0x62, 0xa7, 0xd0, 0x13, + 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, + 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xb2, 0x4e, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, + 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, 0x49, 0x65, 0x65, 0x26, 0xba, 0xc9, 0x19, 0x89, 0x99, 0x79, + 0xfa, 0x70, 0x91, 0x0a, 0xe4, 0xb4, 0x5c, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x96, 0x33, 0x06, + 0x04, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x95, 0x2b, 0x09, 0xf2, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -274,7 +272,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) SetLimitParams(ctx context.Context, in *MsgSetLimitParams, opts ...grpc.CallOption) (*MsgSetLimitParamsResponse, error) { out := new(MsgSetLimitParamsResponse) - err := c.cc.Invoke(ctx, "/dydxprotocol.ibcratelimit.Msg/SetLimitParams", in, out, opts...) + err := c.cc.Invoke(ctx, "/dydxprotocol.ratelimit.Msg/SetLimitParams", in, out, opts...) if err != nil { return nil, err } @@ -283,7 +281,7 @@ func (c *msgClient) SetLimitParams(ctx context.Context, in *MsgSetLimitParams, o func (c *msgClient) DeleteLimitParams(ctx context.Context, in *MsgDeleteLimitParams, opts ...grpc.CallOption) (*MsgDeleteLimitParamsResponse, error) { out := new(MsgDeleteLimitParamsResponse) - err := c.cc.Invoke(ctx, "/dydxprotocol.ibcratelimit.Msg/DeleteLimitParams", in, out, opts...) + err := c.cc.Invoke(ctx, "/dydxprotocol.ratelimit.Msg/DeleteLimitParams", in, out, opts...) if err != nil { return nil, err } @@ -323,7 +321,7 @@ func _Msg_SetLimitParams_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/dydxprotocol.ibcratelimit.Msg/SetLimitParams", + FullMethod: "/dydxprotocol.ratelimit.Msg/SetLimitParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).SetLimitParams(ctx, req.(*MsgSetLimitParams)) @@ -341,7 +339,7 @@ func _Msg_DeleteLimitParams_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/dydxprotocol.ibcratelimit.Msg/DeleteLimitParams", + FullMethod: "/dydxprotocol.ratelimit.Msg/DeleteLimitParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).DeleteLimitParams(ctx, req.(*MsgDeleteLimitParams)) @@ -350,7 +348,7 @@ func _Msg_DeleteLimitParams_Handler(srv interface{}, ctx context.Context, dec fu } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "dydxprotocol.ibcratelimit.Msg", + ServiceName: "dydxprotocol.ratelimit.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -363,7 +361,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "dydxprotocol/ibcratelimit/tx.proto", + Metadata: "dydxprotocol/ratelimit/tx.proto", } func (m *MsgSetLimitParams) Marshal() (dAtA []byte, err error) { diff --git a/protocol/x/ibcratelimit/types/types.go b/protocol/x/ratelimit/types/types.go similarity index 100% rename from protocol/x/ibcratelimit/types/types.go rename to protocol/x/ratelimit/types/types.go From 415990e0a09997b43cc2cfa936be51739038da25 Mon Sep 17 00:00:00 2001 From: Teddy Ding Date: Tue, 12 Dec 2023 10:37:09 -0500 Subject: [PATCH 5/5] idnexer codegen --- .../src/codegen/dydxprotocol/bundle.ts | 102 +++++++++--------- .../v4-protos/src/codegen/dydxprotocol/lcd.ts | 6 +- .../{ibcratelimit => ratelimit}/capacity.ts | 0 .../{ibcratelimit => ratelimit}/genesis.ts | 0 .../limit_params.ts | 0 .../{ibcratelimit => ratelimit}/query.lcd.ts | 0 .../query.rpc.Query.ts | 0 .../{ibcratelimit => ratelimit}/query.ts | 0 .../{ibcratelimit => ratelimit}/tx.rpc.msg.ts | 0 .../{ibcratelimit => ratelimit}/tx.ts | 0 .../src/codegen/dydxprotocol/rpc.query.ts | 2 +- .../src/codegen/dydxprotocol/rpc.tx.ts | 2 +- 12 files changed, 56 insertions(+), 56 deletions(-) rename indexer/packages/v4-protos/src/codegen/dydxprotocol/{ibcratelimit => ratelimit}/capacity.ts (100%) rename indexer/packages/v4-protos/src/codegen/dydxprotocol/{ibcratelimit => ratelimit}/genesis.ts (100%) rename indexer/packages/v4-protos/src/codegen/dydxprotocol/{ibcratelimit => ratelimit}/limit_params.ts (100%) rename indexer/packages/v4-protos/src/codegen/dydxprotocol/{ibcratelimit => ratelimit}/query.lcd.ts (100%) rename indexer/packages/v4-protos/src/codegen/dydxprotocol/{ibcratelimit => ratelimit}/query.rpc.Query.ts (100%) rename indexer/packages/v4-protos/src/codegen/dydxprotocol/{ibcratelimit => ratelimit}/query.ts (100%) rename indexer/packages/v4-protos/src/codegen/dydxprotocol/{ibcratelimit => ratelimit}/tx.rpc.msg.ts (100%) rename indexer/packages/v4-protos/src/codegen/dydxprotocol/{ibcratelimit => ratelimit}/tx.ts (100%) diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts index b79929bc81..680ae1ba54 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts @@ -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 "./ratelimit/capacity"; -import * as _50 from "./ratelimit/genesis"; -import * as _51 from "./ratelimit/limit_params"; -import * as _52 from "./ratelimit/query"; -import * as _53 from "./ratelimit/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"; @@ -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 "./ratelimit/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"; @@ -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 "./ratelimit/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"; @@ -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 "./ratelimit/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"; @@ -208,35 +208,35 @@ export namespace dydxprotocol { ..._122, ..._135 }; - export const ratelimit = { ..._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, @@ -245,7 +245,7 @@ export namespace dydxprotocol { ..._124, ..._137 }; - export const prices = { ..._67, + export const ratelimit = { ..._67, ..._68, ..._69, ..._70, diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts index fe64a9d258..318178b12f 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts @@ -30,15 +30,15 @@ export const createLCDClient = async ({ feetiers: new (await import("./feetiers/query.lcd")).LCDQueryClient({ requestClient }), - ratelimit: new (await import("./ratelimit/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 }), diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/capacity.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/capacity.ts similarity index 100% rename from indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/capacity.ts rename to indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/capacity.ts diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/genesis.ts similarity index 100% rename from indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts rename to indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/genesis.ts diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/limit_params.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/limit_params.ts similarity index 100% rename from indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/limit_params.ts rename to indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/limit_params.ts diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/query.lcd.ts similarity index 100% rename from indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts rename to indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/query.lcd.ts diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/query.rpc.Query.ts similarity index 100% rename from indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts rename to indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/query.rpc.Query.ts diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/query.ts similarity index 100% rename from indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.ts rename to indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/query.ts diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/tx.rpc.msg.ts similarity index 100% rename from indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts rename to indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/tx.rpc.msg.ts diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/tx.ts similarity index 100% rename from indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.ts rename to indexer/packages/v4-protos/src/codegen/dydxprotocol/ratelimit/tx.ts diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts index dfc0119806..546196beeb 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts @@ -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), - ratelimit: (await import("./ratelimit/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), diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts index 8dfac14795..a76b1b51e9 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts @@ -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), - ratelimit: new (await import("./ratelimit/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),