diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d68c7f32..d400de76b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#1503](https://github.com/NibiruChain/nibiru/pull/1503) - feat(wasm): add Oracle Exchange Rate query for wasm * [#1543](https://github.com/NibiruChain/nibiru/pull/1543) - epic(devgas): devgas module for incentivizing smart contract * [#1559](https://github.com/NibiruChain/nibiru/pull/1559) - feat: add versions to markets to allow to disable them +* [#1585](https://github.com/NibiruChain/nibiru/pull/1585) - feat: include flag versioned in query markets to allow to query disabled markets ### Bug Fixes @@ -649,4 +650,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Testing * [#695](https://github.com/NibiruChain/nibiru/pull/695) Add `OpenPosition` integration tests. -* [#692](https://github.com/NibiruChain/nibiru/pull/692) Add test coverage for Perp MsgServer methods. \ No newline at end of file +* [#692](https://github.com/NibiruChain/nibiru/pull/692) Add test coverage for Perp MsgServer methods. diff --git a/proto/nibiru/perp/v2/genesis.proto b/proto/nibiru/perp/v2/genesis.proto index 26da3f342..86a7ee0c4 100644 --- a/proto/nibiru/perp/v2/genesis.proto +++ b/proto/nibiru/perp/v2/genesis.proto @@ -10,11 +10,11 @@ import "nibiru/perp/v2/state.proto"; option go_package = "github.com/NibiruChain/nibiru/x/perp/v2/types"; // GenesisState defines the perp module's genesis state. +// Thge genesis state is used not only to start the network but also useful for +// exporting and importing state during network upgrades. message GenesisState { repeated Market markets = 2 [ (gogoproto.nullable) = false ]; - repeated GenesisMarketLastVersion market_last_versions = 8 [ (gogoproto.nullable) = false ]; - repeated AMM amms = 3 [ (gogoproto.nullable) = false ]; repeated Position positions = 4 [ (gogoproto.nullable) = false ]; @@ -34,9 +34,13 @@ message GenesisState { (gogoproto.nullable) = false ]; } + + repeated GenesisMarketLastVersion market_last_versions = 8 + [ (gogoproto.nullable) = false ]; } -// GenesisMarketLastVersion is the last version including pair only used for genesis +// GenesisMarketLastVersion is the last version including pair only used for +// genesis message GenesisMarketLastVersion { string pair = 1 [ (gogoproto.customtype) = @@ -45,4 +49,4 @@ message GenesisMarketLastVersion { ]; uint64 version = 2; -} \ No newline at end of file +} diff --git a/proto/nibiru/perp/v2/query.proto b/proto/nibiru/perp/v2/query.proto index c2182bbda..e15cb30df 100644 --- a/proto/nibiru/perp/v2/query.proto +++ b/proto/nibiru/perp/v2/query.proto @@ -119,7 +119,9 @@ message AmmMarket { AMM amm = 2 [ (gogoproto.nullable) = false ]; } -message QueryMarketsRequest {} +message QueryMarketsRequest { + bool versioned = 1; +} message QueryMarketsResponse { repeated AmmMarket amm_markets = 1 [ (gogoproto.nullable) = false ]; diff --git a/proto/nibiru/tokenfactory/v1/state.proto b/proto/nibiru/tokenfactory/v1/state.proto new file mode 100644 index 000000000..255398aa2 --- /dev/null +++ b/proto/nibiru/tokenfactory/v1/state.proto @@ -0,0 +1,91 @@ +syntax = "proto3"; + +package nibiru.tokenfactory.v1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/NibiruChain/nibiru/x/tokenfactory/types"; + +// DenomAuthorityMetadata specifies metadata foraddresses that have specific +// capabilities over a token factory denom. Right now there is only one Admin +// permission, but is planned to be extended to the future. +message DenomAuthorityMetadata { + option (gogoproto.equal) = true; + + // Admin: Bech32 address of the admin for the tokefactory denom. Can be empty + // for no admin. + string admin = 1 [ (gogoproto.moretags) = "yaml:\"admin\"" ]; +} + +// ModuleParams defines the parameters for the tokenfactory module. +// +// ### On Denom Creation Costs +// +// We'd like for fees to be paid by the user/signer of a ransaction, but in many +// casess, token creation is abstracted away behind a smart contract. Setting a +// nonzero `denom_creation_fee` would force each contract to handle collecting +// and paying a fees for denom (factory/{contract-addr}/{subdenom}) creation on +// behalf of the end user. +// +// For IBC token transfers, it's unclear who should pay the feeā€”the contract, +// the relayer, or the original sender? +// > "Charging fees will mess up composability, the same way Terra transfer tax +// caused all kinds of headaches for contract devs." - @ethanfrey +// +// ### Recommended Solution +// +// Have the end user (signer) pay fees directly in the form of higher gas costs. +// This way, contracts won't need to handle collecting or paying fees. And for +// IBC, the gas costs are already paid by the original sender and can be +// estimated by the relayer. It's easier to tune gas costs to make spam +// prohibitively expensive since there are per-transaction and per-block gas +// limits. +// +// See https://github.com/CosmWasm/token-factory/issues/11 for the initial +// discussion of the issue with @ethanfrey and @valardragon. +message ModuleParams { + // Adds gas consumption to the execution of `MsgCreateDenom` as a method of + // spam prevention. Defaults to 10 NIBI. + uint64 denom_creation_gas_consume = 1 + [ (gogoproto.moretags) = "yaml:\"denom_creation_gas_consume\"" ]; +} + +// TFDenom is a token factory (TF) denom. The canonical representation is +// "tf/{creator}/{subdenom}", its unique denomination in the x/bank module. +message TFDenom { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + + // Creator: Bech32 address of the creator of the denom. + string creator = 1; + // Subdenom: Unique suffix of a token factory denom. A subdenom is specific + // to a given creator. It is the name given during a token factory "Mint". + string subdenom = 2; +} + +// ---------------------------------------------- +// Genesis +// ---------------------------------------------- + +// GenesisState for the Token Factory module. +message GenesisState { + ModuleParams params = 1 [ (gogoproto.nullable) = false ]; + + repeated GenesisDenom factory_denoms = 2 [ + (gogoproto.moretags) = "yaml:\"factory_denoms\"", + (gogoproto.nullable) = false + ]; +} + +// GenesisDenom defines a tokenfactory denoms in the genesis state. +message GenesisDenom { + option (gogoproto.equal) = true; + + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + DenomAuthorityMetadata authority_metadata = 2 [ + (gogoproto.moretags) = "yaml:\"authority_metadata\"", + (gogoproto.nullable) = false + ]; +} diff --git a/x/perp/v2/client/cli/query.go b/x/perp/v2/client/cli/query.go index fa9601263..12967a4a0 100644 --- a/x/perp/v2/client/cli/query.go +++ b/x/perp/v2/client/cli/query.go @@ -12,6 +12,8 @@ import ( types "github.com/NibiruChain/nibiru/x/perp/v2/types" ) +const FlagVersioned = "versioned" + // GetQueryCmd returns the cli query commands for this module func GetQueryCmd() *cobra.Command { // Group stablecoin queries under a subcommand @@ -146,8 +148,12 @@ func CmdQueryModuleAccounts() *cobra.Command { func CmdQueryMarkets() *cobra.Command { cmd := &cobra.Command{ Use: "markets", - Short: "query all market info", - Args: cobra.NoArgs, + Short: "Query all market info", + Long: ` +Query all market info. By default, only active tradable markets are shown. +If --versioned is to to true, the query will return all markets including the +inactive ones.`, + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { @@ -156,7 +162,14 @@ func CmdQueryMarkets() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.QueryMarkets(cmd.Context(), &types.QueryMarketsRequest{}) + versioned, err := cmd.Flags().GetBool(FlagVersioned) + if err != nil { + return err + } + + res, err := queryClient.QueryMarkets(cmd.Context(), &types.QueryMarketsRequest{ + Versioned: versioned, + }) if err != nil { return err } @@ -165,6 +178,8 @@ func CmdQueryMarkets() *cobra.Command { }, } + cmd.Flags().Bool(FlagVersioned, false, "toggles whether to include inactive markets") + flags.AddQueryFlagsToCmd(cmd) return cmd diff --git a/x/perp/v2/integration/action/market.go b/x/perp/v2/integration/action/market.go index fa5635504..e61e41cf9 100644 --- a/x/perp/v2/integration/action/market.go +++ b/x/perp/v2/integration/action/market.go @@ -52,7 +52,7 @@ func (c createMarketAction) Do(app *app.NibiruApp, ctx sdk.Context) (sdk.Context } // CreateCustomMarket creates a market with custom parameters -func CreateCustomMarket(pair asset.Pair, marketModifiers ...marketModifier) action.Action { +func CreateCustomMarket(pair asset.Pair, marketModifiers ...MarketModifier) action.Action { market := types.DefaultMarket(pair) amm := types.AMM{ Pair: pair, @@ -75,33 +75,33 @@ func CreateCustomMarket(pair asset.Pair, marketModifiers ...marketModifier) acti } } -type marketModifier func(market *types.Market, amm *types.AMM) +type MarketModifier func(market *types.Market, amm *types.AMM) -func WithPrepaidBadDebt(amount sdkmath.Int) marketModifier { +func WithPrepaidBadDebt(amount sdkmath.Int) MarketModifier { return func(market *types.Market, amm *types.AMM) { market.PrepaidBadDebt = sdk.NewCoin(market.Pair.QuoteDenom(), amount) } } -func WithPricePeg(newValue sdk.Dec) marketModifier { +func WithPricePeg(newValue sdk.Dec) MarketModifier { return func(market *types.Market, amm *types.AMM) { amm.PriceMultiplier = newValue } } -func WithTotalLong(amount sdk.Dec) marketModifier { +func WithTotalLong(amount sdk.Dec) MarketModifier { return func(market *types.Market, amm *types.AMM) { amm.TotalLong = amount } } -func WithTotalShort(amount sdk.Dec) marketModifier { +func WithTotalShort(amount sdk.Dec) MarketModifier { return func(market *types.Market, amm *types.AMM) { amm.TotalShort = amount } } -func WithSqrtDepth(amount sdk.Dec) marketModifier { +func WithSqrtDepth(amount sdk.Dec) MarketModifier { return func(market *types.Market, amm *types.AMM) { amm.SqrtDepth = amount amm.BaseReserve = amount @@ -109,18 +109,31 @@ func WithSqrtDepth(amount sdk.Dec) marketModifier { } } -func WithLatestMarketCPF(amount sdk.Dec) marketModifier { +func WithLatestMarketCPF(amount sdk.Dec) MarketModifier { return func(market *types.Market, amm *types.AMM) { market.LatestCumulativePremiumFraction = amount } } -func WithMaxFundingRate(amount sdk.Dec) marketModifier { +func WithMaxFundingRate(amount sdk.Dec) MarketModifier { return func(market *types.Market, amm *types.AMM) { market.MaxFundingRate = amount } } +func WithVersion(version uint64) MarketModifier { + return func(market *types.Market, amm *types.AMM) { + market.Version = version + amm.Version = version + } +} + +func WithEnabled(enabled bool) MarketModifier { + return func(market *types.Market, amm *types.AMM) { + market.Enabled = enabled + } +} + type editPriceMultiplier struct { pair asset.Pair newValue sdk.Dec diff --git a/x/perp/v2/integration/action/query.go b/x/perp/v2/integration/action/query.go index 06aa705e6..0928cfae7 100644 --- a/x/perp/v2/integration/action/query.go +++ b/x/perp/v2/integration/action/query.go @@ -131,7 +131,11 @@ func (q queryPositionNotFound) Do(app *app.NibiruApp, ctx sdk.Context) (sdk.Cont Trader: q.traderAddress.String(), }) if !errors.Is(err, collections.ErrNotFound) { - return ctx, fmt.Errorf("expected position not found, but found a position for pair %s, trader %s", q.pair, q.traderAddress), false + return ctx, fmt.Errorf( + "expected position not found, but found a position for pair %s, trader %s", + q.pair, + q.traderAddress, + ), false } return ctx, nil, false @@ -145,13 +149,16 @@ func QueryPositionNotFound(pair asset.Pair, traderAddress sdk.AccAddress) action } type queryMarkets struct { + versioned bool allResponseCheckers []QueryMarketsChecker } func (q queryMarkets) Do(app *app.NibiruApp, ctx sdk.Context) (sdk.Context, error, bool) { queryServer := keeper.NewQuerier(app.PerpKeeperV2) - resp, err := queryServer.QueryMarkets(sdk.WrapSDKContext(ctx), &types.QueryMarketsRequest{}) + resp, err := queryServer.QueryMarkets(sdk.WrapSDKContext(ctx), &types.QueryMarketsRequest{ + Versioned: q.versioned, + }) if err != nil { return ctx, err, false } @@ -165,8 +172,10 @@ func (q queryMarkets) Do(app *app.NibiruApp, ctx sdk.Context) (sdk.Context, erro return ctx, nil, false } -func QueryMarkets(responseCheckers ...QueryMarketsChecker) action.Action { +// QueryMarkets queries all markets, versioned contains active and inactive markets +func QueryMarkets(versioned bool, responseCheckers ...QueryMarketsChecker) action.Action { return queryMarkets{ + versioned: versioned, allResponseCheckers: responseCheckers, } } @@ -188,6 +197,16 @@ func QueryMarkets_MarketsShouldContain(expectedMarket types.Market) QueryMarkets } } +func QueryMarkets_ShouldLength(length int) QueryMarketsChecker { + return func(resp []types.AmmMarket) error { + if len(resp) != length { + return fmt.Errorf("expected markets to have length %d, got %d", length, len(resp)) + } + + return nil + } +} + type queryModuleAccounts struct { allResponseCheckers []QueryModuleAccountsChecker } diff --git a/x/perp/v2/keeper/grpc_query.go b/x/perp/v2/keeper/grpc_query.go index 7b1307193..72be07dc6 100644 --- a/x/perp/v2/keeper/grpc_query.go +++ b/x/perp/v2/keeper/grpc_query.go @@ -164,7 +164,7 @@ func (q queryServer) ModuleAccounts( } func (q queryServer) QueryMarkets( - goCtx context.Context, _ *types.QueryMarketsRequest, + goCtx context.Context, req *types.QueryMarketsRequest, ) (*types.QueryMarketsResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -172,7 +172,7 @@ func (q queryServer) QueryMarkets( markets := q.k.Markets.Iterate(ctx, collections.Range[collections.Pair[asset.Pair, uint64]]{}).Values() for _, market := range markets { // disabled markets are not returned - if !market.Enabled { + if !req.Versioned && !market.Enabled { continue } diff --git a/x/perp/v2/keeper/grpc_query_test.go b/x/perp/v2/keeper/grpc_query_test.go index 4fc736d94..09302cac4 100644 --- a/x/perp/v2/keeper/grpc_query_test.go +++ b/x/perp/v2/keeper/grpc_query_test.go @@ -348,7 +348,7 @@ func TestQueryMarkets(t *testing.T) { ), ). Then( - QueryMarkets(QueryMarkets_MarketsShouldContain(types.DefaultMarket(pair))), + QueryMarkets(false, QueryMarkets_MarketsShouldContain(types.DefaultMarket(pair))), QueryModuleAccounts(QueryModuleAccounts_ModulesBalanceShouldBe( map[string]sdk.Coins{ "perp_ef": sdk.NewCoins( @@ -358,6 +358,20 @@ func TestQueryMarkets(t *testing.T) { }, )), ), + TC("versioned, all markets (active and inactive)").Given( + CreateCustomMarket("BTC:USD", WithVersion(1), WithEnabled(true)), + CreateCustomMarket("ETC:USD", WithVersion(1), WithEnabled(false)), + CreateCustomMarket("ETC:USD", WithVersion(2), WithEnabled(true)), + ).Then( + QueryMarkets(true, QueryMarkets_ShouldLength(3)), + ), + TC("not versioned, only active markets").Given( + CreateCustomMarket("BTC:USD", WithVersion(1), WithEnabled(true)), + CreateCustomMarket("ETC:USD", WithVersion(1), WithEnabled(false)), + CreateCustomMarket("ETC:USD", WithVersion(2), WithEnabled(true)), + ).Then( + QueryMarkets(true, QueryMarkets_ShouldLength(3)), + ), } NewTestSuite(t).WithTestCases(tc...).Run() diff --git a/x/perp/v2/keeper/twap.go b/x/perp/v2/keeper/twap.go index 05aef231a..b84f261ac 100644 --- a/x/perp/v2/keeper/twap.go +++ b/x/perp/v2/keeper/twap.go @@ -11,7 +11,7 @@ import ( ) /* -Gets the time-weighted average price from [ ctx.BlockTime() - interval, ctx.BlockTime() ) +CalcTwap Gets the time-weighted average price from [ ctx.BlockTime() - interval, ctx.BlockTime() ) Note the open-ended right bracket. args: diff --git a/x/perp/v2/types/genesis.pb.go b/x/perp/v2/types/genesis.pb.go index c716c8ee9..2e5f22760 100644 --- a/x/perp/v2/types/genesis.pb.go +++ b/x/perp/v2/types/genesis.pb.go @@ -28,14 +28,16 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the perp module's genesis state. +// Thge genesis state is used not only to start the network but also useful for +// exporting and importing state during network upgrades. type GenesisState struct { Markets []Market `protobuf:"bytes,2,rep,name=markets,proto3" json:"markets"` - MarketLastVersions []GenesisMarketLastVersion `protobuf:"bytes,8,rep,name=market_last_versions,json=marketLastVersions,proto3" json:"market_last_versions"` Amms []AMM `protobuf:"bytes,3,rep,name=amms,proto3" json:"amms"` Positions []Position `protobuf:"bytes,4,rep,name=positions,proto3" json:"positions"` ReserveSnapshots []ReserveSnapshot `protobuf:"bytes,5,rep,name=reserve_snapshots,json=reserveSnapshots,proto3" json:"reserve_snapshots"` DnrEpoch uint64 `protobuf:"varint,6,opt,name=dnr_epoch,json=dnrEpoch,proto3" json:"dnr_epoch,omitempty"` TraderVolumes []GenesisState_TraderVolume `protobuf:"bytes,7,rep,name=trader_volumes,json=traderVolumes,proto3" json:"trader_volumes"` + MarketLastVersions []GenesisMarketLastVersion `protobuf:"bytes,8,rep,name=market_last_versions,json=marketLastVersions,proto3" json:"market_last_versions"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -78,13 +80,6 @@ func (m *GenesisState) GetMarkets() []Market { return nil } -func (m *GenesisState) GetMarketLastVersions() []GenesisMarketLastVersion { - if m != nil { - return m.MarketLastVersions - } - return nil -} - func (m *GenesisState) GetAmms() []AMM { if m != nil { return m.Amms @@ -120,6 +115,13 @@ func (m *GenesisState) GetTraderVolumes() []GenesisState_TraderVolume { return nil } +func (m *GenesisState) GetMarketLastVersions() []GenesisMarketLastVersion { + if m != nil { + return m.MarketLastVersions + } + return nil +} + type GenesisState_TraderVolume struct { Trader string `protobuf:"bytes,1,opt,name=trader,proto3" json:"trader,omitempty"` Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"` @@ -173,7 +175,8 @@ func (m *GenesisState_TraderVolume) GetEpoch() uint64 { return 0 } -// GenesisMarketLastVersion is the last version including pair only used for genesis +// GenesisMarketLastVersion is the last version including pair only used for +// genesis type GenesisMarketLastVersion struct { Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,1,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` @@ -228,41 +231,41 @@ func init() { func init() { proto.RegisterFile("nibiru/perp/v2/genesis.proto", fileDescriptor_c2c7acfef3993fde) } var fileDescriptor_c2c7acfef3993fde = []byte{ - // 535 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xcf, 0x6a, 0x13, 0x41, - 0x18, 0xcf, 0x36, 0xdb, 0xa4, 0x19, 0x6b, 0xd1, 0x31, 0x94, 0x21, 0x96, 0x4d, 0xe8, 0x41, 0xe2, + // 534 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x4f, 0x6b, 0x13, 0x41, + 0x14, 0xcf, 0x36, 0xdb, 0xa4, 0x19, 0x6b, 0xd1, 0x31, 0x94, 0x25, 0x96, 0x4d, 0xe8, 0x41, 0xe2, 0x21, 0x3b, 0x24, 0x82, 0x20, 0x78, 0x31, 0xa2, 0x45, 0x30, 0x52, 0xb6,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x9c, 0xc9, 0x94, 0xba, 0xe3, 0x67, 0x1f, - 0x3d, 0x98, 0x5f, 0x52, 0xfd, 0x35, 0xe3, 0x10, 0xbe, 0x13, 0x3a, 0x72, 0xea, 0xd3, 0x6f, 0x1e, - 0x22, 0x77, 0xfd, 0x73, 0x3c, 0x42, 0x7e, 0xc6, 0x12, 0x57, 0x68, 0xf8, 0xc2, 0x45, 0xf4, 0x77, - 0x22, 0x3e, 0x98, 0x3d, 0x78, 0xbd, 0x60, 0x89, 0xa0, 0xee, 0x34, 0x7f, 0xa1, 0x33, 0x99, 0xa6, - 0x52, 0x50, 0x06, 0xc0, 0x75, 0x78, 0xce, 0x12, 0x15, 0x19, 0x1b, 0x4c, 0x50, 0xdd, 0x1d, 0x3f, - 0xf7, 0x2d, 0xdb, 0x71, 0x78, 0x76, 0xb5, 0x0e, 0xbc, 0xeb, 0x75, 0xe0, 0xfd, 0x5e, 0x07, 0xde, - 0x8f, 0x4d, 0x50, 0xb9, 0xde, 0x04, 0x95, 0x9f, 0x9b, 0xa0, 0xf2, 0xa9, 0xf7, 0xbf, 0xb0, 0xed, - 0xe5, 0x31, 0x9f, 0x36, 0xad, 0x99, 0xdb, 0xf3, 0xec, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1b, - 0xac, 0x6f, 0xb7, 0xdd, 0x03, 0x00, 0x00, + 0x49, 0x86, 0xcd, 0xd0, 0xec, 0xcc, 0x32, 0x6f, 0xb2, 0xe8, 0x59, 0x3f, 0x80, 0x1f, 0xab, 0xc7, + 0x1e, 0xc5, 0x43, 0x91, 0x04, 0xbf, 0x87, 0xec, 0xcc, 0x04, 0xd3, 0x85, 0xe2, 0x29, 0x79, 0xf3, + 0x7e, 0xff, 0xde, 0xdb, 0x19, 0x74, 0x22, 0xf8, 0x94, 0xab, 0x15, 0xc9, 0x98, 0xca, 0x48, 0x3e, + 0x20, 0x09, 0x13, 0x0c, 0x38, 0x44, 0x99, 0x92, 0x5a, 0xe2, 0x23, 0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15, 0x1b, 0x19, 0x1c, 0xa0, 0xba, 0x5b, 0xa4, + 0x9b, 0x65, 0x5b, 0x0e, 0xcf, 0xae, 0xd6, 0xa1, 0x77, 0xbd, 0x0e, 0xbd, 0xdf, 0xeb, 0xd0, 0xfb, + 0xb1, 0x09, 0x2b, 0xd7, 0x9b, 0xb0, 0xf2, 0x73, 0x13, 0x56, 0x3e, 0xf5, 0xfe, 0x67, 0xb6, 0x7d, + 0x3c, 0x66, 0xb4, 0x69, 0xcd, 0xbc, 0x9e, 0x67, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x02, 0x3e, + 0x48, 0xb0, 0xdd, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/perp/v2/types/query.pb.go b/x/perp/v2/types/query.pb.go index f36919ad8..b66a0e70f 100644 --- a/x/perp/v2/types/query.pb.go +++ b/x/perp/v2/types/query.pb.go @@ -512,6 +512,7 @@ func (m *AmmMarket) GetAmm() AMM { } type QueryMarketsRequest struct { + Versioned bool `protobuf:"varint,1,opt,name=versioned,proto3" json:"versioned,omitempty"` } func (m *QueryMarketsRequest) Reset() { *m = QueryMarketsRequest{} } @@ -547,6 +548,13 @@ func (m *QueryMarketsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryMarketsRequest proto.InternalMessageInfo +func (m *QueryMarketsRequest) GetVersioned() bool { + if m != nil { + return m.Versioned + } + return false +} + type QueryMarketsResponse struct { AmmMarkets []AmmMarket `protobuf:"bytes,1,rep,name=amm_markets,json=ammMarkets,proto3" json:"amm_markets"` } @@ -609,63 +617,64 @@ func init() { func init() { proto.RegisterFile("nibiru/perp/v2/query.proto", fileDescriptor_fc8f0be94fac333f) } var fileDescriptor_fc8f0be94fac333f = []byte{ - // 887 bytes of a gzipped FileDescriptorProto + // 904 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x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xf2, 0x19, 0x99, 0x70, 0x9e, 0x4c, 0x26, 0x09, 0x15, 0x42, 0xcd, 0x88, 0x7e, 0x45, 0x14, 0xce, - 0x8f, 0x73, 0x47, 0xb3, 0x26, 0x99, 0xb4, 0x0a, 0x93, 0xae, 0x67, 0xfc, 0x3e, 0x0f, 0x59, 0xff, - 0xa3, 0x8c, 0xc0, 0x1f, 0xff, 0xb4, 0x77, 0x37, 0x28, 0x58, 0xe6, 0x20, 0x3c, 0x1d, 0xdb, 0x61, - 0xb0, 0x7d, 0x2f, 0x8a, 0x06, 0x24, 0x79, 0x42, 0x53, 0xf4, 0x09, 0x6c, 0x45, 0xf2, 0x49, 0x0d, - 0xdf, 0x4e, 0x59, 0x7c, 0x8e, 0x53, 0x82, 0x15, 0x16, 0xdd, 0x81, 0x1a, 0x89, 0x22, 0xb5, 0x8f, - 0x97, 0x97, 0xea, 0x35, 0x18, 0x28, 0x7c, 0x86, 0x72, 0xae, 0xc2, 0xe5, 0xbc, 0x01, 0xd2, 0x77, - 0xde, 0x97, 0xef, 0xd4, 0x46, 0xce, 0x8f, 0x55, 0x43, 0xbe, 0x80, 0x06, 0x89, 0xa2, 0x51, 0x9e, - 0x49, 0xf7, 0xa4, 0xb5, 0x94, 0x43, 0x2b, 0x50, 0x99, 0x80, 0xe8, 0x03, 0xd1, 0xfb, 0xf3, 0x1c, - 0x9c, 0x93, 0xa1, 0xd1, 0xcf, 0x70, 0xa9, 0xb0, 0x75, 0xe8, 0xe6, 0x9a, 0x9b, 0x54, 0x52, 0xb3, - 0x36, 0xbb, 0x6f, 0x9d, 0xce, 0x8b, 0xbf, 0xfe, 0x7b, 0x59, 0xb5, 0x90, 0x89, 0x4b, 0x5f, 0x99, - 0xf9, 0x82, 0xbe, 0x30, 0xa0, 0x59, 0xbc, 0xe6, 0xd1, 0xe9, 0xb1, 0x75, 0x75, 0xac, 0xee, 0x3a, - 0x98, 0xe2, 0x70, 0x43, 0x72, 0xb8, 0x86, 0x5a, 0x27, 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1a, 0xcf, 0xb8, 0x1e, 0x27, 0xa2, 0x95, 0xe0, + 0xd0, 0x4f, 0x80, 0xe8, 0x47, 0xe0, 0x04, 0x57, 0xbe, 0x44, 0x8f, 0x95, 0xb8, 0xa0, 0x1e, 0x0a, + 0xda, 0xe5, 0x83, 0x20, 0x8f, 0x67, 0x92, 0xd8, 0x49, 0x37, 0x51, 0x4f, 0xb1, 0xfd, 0x7e, 0xef, + 0xbd, 0xdf, 0xef, 0xfd, 0x99, 0x09, 0x38, 0x9c, 0xf5, 0x59, 0x3a, 0xc2, 0x09, 0x4d, 0x13, 0x3c, + 0x6e, 0xe1, 0xc7, 0x23, 0x9a, 0x3e, 0xf1, 0x93, 0x54, 0x64, 0x02, 0xed, 0x15, 0x36, 0x3f, 0xb7, + 0xf9, 0xe3, 0x96, 0x73, 0x39, 0x12, 0x91, 0x50, 0x26, 0x9c, 0x3f, 0x15, 0x28, 0xe7, 0x20, 0x12, + 0x22, 0x1a, 0x52, 0x4c, 0x12, 0x86, 0x09, 0xe7, 0x22, 0x23, 0x19, 0x13, 0x5c, 0x6a, 0x6b, 0x35, + 0xbe, 0xcc, 0x48, 0x46, 0xb5, 0xcd, 0x0d, 0x85, 0x8c, 0x85, 0xc4, 0x7d, 0x22, 0x29, 0x1e, 0x1f, + 0xf5, 0x69, 0x46, 0x8e, 0x70, 0x28, 0x18, 0xd7, 0xf6, 0x1b, 0xb3, 0x76, 0x45, 0x6c, 0x82, 0x4a, + 0x48, 0xc4, 0xb8, 0x4a, 0x54, 0x60, 0x3d, 0x0c, 0xef, 0x3d, 0xcc, 0x11, 0x5d, 0x21, 0x99, 0xca, + 0x1f, 0xd0, 0xc7, 0x23, 0x2a, 0x33, 0xb4, 0x0f, 0x5b, 0x59, 0x4a, 0x06, 0x34, 0xb5, 0xad, 0x86, + 0x75, 0xb8, 0x13, 0xe8, 0x37, 0x2f, 0x84, 0xfd, 0xaa, 0x83, 0x4c, 0x04, 0x97, 0x14, 0x7d, 0x05, + 0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 0x72, 0xdf, 0x44, 0xa8, 0x27, 0x55, 0xfa, 0x5f, 0x2d, 0xd8, 0x2b, 0x2f, 0x2c, 0x5a, + 0x9c, 0x66, 0xe1, 0xce, 0x3b, 0x37, 0x57, 0xc2, 0x6a, 0x4e, 0xd7, 0x15, 0xa7, 0xab, 0xa8, 0x5e, + 0xe5, 0x14, 0x2b, 0x7c, 0xcf, 0x2c, 0x39, 0x7a, 0x0a, 0x17, 0x66, 0x67, 0x12, 0x7d, 0xb0, 0x38, + 0x4b, 0x69, 0xcc, 0x9d, 0x6b, 0x67, 0x83, 0x34, 0x87, 0xba, 0xe2, 0x50, 0x43, 0xef, 0xcf, 0x71, + 0x28, 0x80, 0xed, 0xfb, 0x2f, 0x4e, 0x5c, 0xeb, 0xe5, 0x89, 0x6b, 0xfd, 0x7b, 0xe2, 0x5a, 0xbf, + 0x9c, 0xba, 0x6b, 0x2f, 0x4f, 0xdd, 0xb5, 0xbf, 0x4f, 0xdd, 0xb5, 0xef, 0x6f, 0x2d, 0xbb, 0xab, + 0x4c, 0x28, 0x75, 0x18, 0xf4, 0xb7, 0xd4, 0x1f, 0x96, 0xdb, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, + 0xbb, 0xf9, 0xd2, 0xa6, 0x7a, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1324,6 +1333,16 @@ func (m *QueryMarketsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Versioned { + i-- + if m.Versioned { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } @@ -1533,6 +1552,9 @@ func (m *QueryMarketsRequest) Size() (n int) { } var l int _ = l + if m.Versioned { + n += 2 + } return n } @@ -2657,6 +2679,26 @@ func (m *QueryMarketsRequest) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: QueryMarketsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Versioned", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Versioned = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/perp/v2/types/query.pb.gw.go b/x/perp/v2/types/query.pb.gw.go index 155f87eb2..d7f2bee0d 100644 --- a/x/perp/v2/types/query.pb.gw.go +++ b/x/perp/v2/types/query.pb.gw.go @@ -159,10 +159,21 @@ func local_request_Query_ModuleAccounts_0(ctx context.Context, marshaler runtime } +var ( + filter_Query_QueryMarkets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + func request_Query_QueryMarkets_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryMarketsRequest var metadata runtime.ServerMetadata + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryMarkets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.QueryMarkets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err @@ -172,6 +183,13 @@ func local_request_Query_QueryMarkets_0(ctx context.Context, marshaler runtime.M var protoReq QueryMarketsRequest var metadata runtime.ServerMetadata + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryMarkets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.QueryMarkets(ctx, &protoReq) return msg, metadata, err