From 3b2d0877b76ecd661722f3c5492e607c0b8abae1 Mon Sep 17 00:00:00 2001 From: Matthias <97468149+matthiasmatt@users.noreply.github.com> Date: Thu, 16 Nov 2023 07:54:35 +0000 Subject: [PATCH] feat(perp): Create query for the stateful collateral metadata (#1669) * feat: add collateral statefull * chore: changelog * test: fix tests wip * fix: fix tests * feat: add admin function call for update collateral * feat: added update collateral to genesis export and loads for test and network migration * fix: lint * fix: rename collateralDenom * fix: fix weird *& * fix: fix margin tests * fix: fix account prefix mismatch * fix: fix when no collateral is in genesis * fix: remove collateral type and use the token factory one * feat: create query to get the collateral * feat: wire this query to the cli * chore: changelog * fix: fix unit test * add query protos + proto docs for all other queries * feat(perp/keeper): implement Query/Collateral gRPC method + tests * test(perp/cli): add network tests with QueryCollateral * test: fix in module basic assertions --------- Co-authored-by: Unique-Divine --- CHANGELOG.md | 1 + proto/nibiru/perp/v2/query.proto | 39 ++- x/perp/v2/client/cli/cli_test.go | 22 +- x/perp/v2/client/cli/query.go | 43 ++- x/perp/v2/client/cli/tx.go | 2 +- x/perp/v2/integration/action/query.go | 30 ++ x/perp/v2/keeper/grpc_query.go | 10 + x/perp/v2/keeper/grpc_query_test.go | 33 ++ x/perp/v2/module/genesis_test.go | 4 +- x/perp/v2/module/module.go | 4 +- x/perp/v2/types/query.pb.go | 479 ++++++++++++++++++++++---- x/perp/v2/types/query.pb.gw.go | 65 ++++ 12 files changed, 653 insertions(+), 79 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf3224e54..0fdde638d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -136,6 +136,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#1555](https://github.com/NibiruChain/nibiru/pull/1555) - feat(devgas): Convert legacy ABCI events to typed proto events * [#1558](https://github.com/NibiruChain/nibiru/pull/1558) - feat(perp): paginated query to read the position store * [#1554](https://github.com/NibiruChain/nibiru/pull/1554) - refactor: runs gofumpt formatter, which has nice conventions: go install mvdan.cc/gofumpt@latest +* [#1669](https://github.com/NibiruChain/nibiru/pull/1669) - feat(perp): add query to get collateral metadata ### Bug Fixes diff --git a/proto/nibiru/perp/v2/query.proto b/proto/nibiru/perp/v2/query.proto index bb69dacdb..7d16b8f0f 100644 --- a/proto/nibiru/perp/v2/query.proto +++ b/proto/nibiru/perp/v2/query.proto @@ -12,10 +12,12 @@ option go_package = "github.com/NibiruChain/nibiru/x/perp/v2/types"; // Query defines the gRPC querier service. service Query { + // QueryPosition: Query one position on the given market for a user rpc QueryPosition(QueryPositionRequest) returns (QueryPositionResponse) { option (google.api.http).get = "/nibiru/perp/v2/position"; } + // QueryPositions: Query all positions for a user rpc QueryPositions(QueryPositionsRequest) returns (QueryPositionsResponse) { option (google.api.http).get = "/nibiru/perp/v2/positions"; } @@ -26,31 +28,46 @@ service Query { option (google.api.http).get = "/nibiru/perp/v2/position_store"; } - // Queries the reserve assets in a given pool, identified by a token pair. + // Queries the module accounts for x/perp rpc ModuleAccounts(QueryModuleAccountsRequest) returns (QueryModuleAccountsResponse) { option (google.api.http).get = "/nibiru/perp/v2/module_accounts"; } + // QueryMarkets: Query all markets rpc QueryMarkets(QueryMarketsRequest) returns (QueryMarketsResponse) { option (google.api.http).get = "/nibiru/perp/v2/markets"; } + + // QueryCollateral: Queries info about the collateral + rpc QueryCollateral(QueryCollateralRequest) + returns (QueryCollateralResponse) { + option (google.api.http).get = "/nibiru/perp/v2/collateral"; + } } // ---------------------------------------- Positions +// QueryPositionsRequest: Request type for the +// "nibiru.perp.v2.Query/Positions" gRPC service method message QueryPositionsRequest { string trader = 1; } +// QueryPositionsResponse: Response type for the +// "nibiru.perp.v2.Query/Positions" gRPC service method message QueryPositionsResponse { repeated nibiru.perp.v2.QueryPositionResponse positions = 1 [ (gogoproto.nullable) = false ]; } +// QueryPositionStoreRequest: Request type for the +// "nibiru.perp.v2.Query/PositionStore" gRPC service method message QueryPositionStoreRequest { // pagination defines a paginated request cosmos.base.query.v1beta1.PageRequest pagination = 1; } +// QueryPositionStoreResponse: Response type for the +// "nibiru.perp.v2.Query/PositionStore" gRPC service method message QueryPositionStoreResponse { // Position responses: collection of all stored positions (with pagination) repeated nibiru.perp.v2.Position positions = 1 @@ -62,8 +79,8 @@ message QueryPositionStoreResponse { // ---------------------------------------- Position -// QueryPositionRequest is the request type for the position of the x/perp -// module account. +// QueryPositionRequest: Request type for the +// "nibiru.perp.v2.Query/Position" gRPC service method message QueryPositionRequest { string pair = 1 [ (gogoproto.customtype) = @@ -74,6 +91,8 @@ message QueryPositionRequest { string trader = 2; } +// QueryPositionResponse: Response type for the +// "nibiru.perp.v2.Query/Position" gRPC service method message QueryPositionResponse { // The position as it exists in the blockchain state nibiru.perp.v2.Position position = 1 [ (gogoproto.nullable) = false ]; @@ -100,8 +119,12 @@ message QueryPositionResponse { // ---------------------------------------- QueryModuleAccounts +// QueryModuleAccountsRequest: Request type for the +// "nibiru.perp.v2.Query/ModuleAccounts" gRPC service method message QueryModuleAccountsRequest {} +// QueryModuleAccountsResponse: Response type for the +// "nibiru.perp.v2.Query/ModuleAccounts" gRPC service method message QueryModuleAccountsResponse { repeated nibiru.perp.v2.AccountWithBalance accounts = 1 [ (gogoproto.nullable) = false ]; @@ -128,3 +151,13 @@ message QueryMarketsResponse { repeated nibiru.perp.v2.AmmMarket amm_markets = 1 [ (gogoproto.nullable) = false ]; } + +// ---------------------------------------- QueryCollateral + +// QueryCollateralRequest: Request type for the +// "nibiru.perp.v2.Query/Collateral" gRPC service method +message QueryCollateralRequest {} + +// QueryCollateralRequest: Response type for the +// "nibiru.perp.v2.Query/Collateral" gRPC service method +message QueryCollateralResponse { string collateral_denom = 1; } diff --git a/x/perp/v2/client/cli/cli_test.go b/x/perp/v2/client/cli/cli_test.go index 2546bdf24..d8dbd2fd1 100644 --- a/x/perp/v2/client/cli/cli_test.go +++ b/x/perp/v2/client/cli/cli_test.go @@ -725,16 +725,28 @@ func (s *IntegrationTestSuite) TestDonateToEcosystemFund() { } func (s *IntegrationTestSuite) TestQueryModuleAccount() { - s.T().Logf("donate to ecosystem fund") resp := new(types.QueryModuleAccountsResponse) s.NoError( - testutilcli.ExecQuery( - s.network.Validators[0].ClientCtx, - cli.CmdQueryModuleAccounts(), - []string{}, + s.network.ExecQuery( + cli.NewQueryCmd(), + []string{"module-accounts"}, + resp, + ), + ) + s.NotEmpty(resp.Accounts) +} + +func (s *IntegrationTestSuite) TestQueryCollateralDenom() { + resp := new(types.QueryCollateralResponse) + s.NoError( + s.network.ExecQuery( + cli.NewQueryCmd(), + []string{"collateral"}, resp, ), ) + s.Equal(types.TestingCollateralDenomNUSD, resp.CollateralDenom, + "resp: %s", resp.String()) } func TestIntegrationTestSuite(t *testing.T) { diff --git a/x/perp/v2/client/cli/query.go b/x/perp/v2/client/cli/query.go index 12967a4a0..8a37b6528 100644 --- a/x/perp/v2/client/cli/query.go +++ b/x/perp/v2/client/cli/query.go @@ -3,6 +3,7 @@ package cli import ( "fmt" + "github.com/MakeNowJust/heredoc/v2" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" @@ -14,8 +15,8 @@ import ( const FlagVersioned = "versioned" -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd() *cobra.Command { +// NewQueryCmd returns the cli query commands for this module +func NewQueryCmd() *cobra.Command { // Group stablecoin queries under a subcommand moduleQueryCmd := &cobra.Command{ Use: types.ModuleName, @@ -31,6 +32,7 @@ func GetQueryCmd() *cobra.Command { CmdQueryPositions(), CmdQueryModuleAccounts(), CmdQueryMarkets(), + CmdQueryCollateral(), } for _, cmd := range cmds { moduleQueryCmd.AddCommand(cmd) @@ -149,10 +151,10 @@ func CmdQueryMarkets() *cobra.Command { cmd := &cobra.Command{ Use: "markets", Short: "Query all market info", - Long: ` + Long: heredoc.Doc(` 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.`, +inactive ones.`), Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) @@ -184,3 +186,36 @@ inactive ones.`, return cmd } + +// CmdQueryCollateral: Command for the "Query/Collateral" gRPC service method. +func CmdQueryCollateral() *cobra.Command { + cmd := &cobra.Command{ + Use: "collateral", + Aliases: []string{"coll"}, + Short: "Query the collateral denomination info.", + Long: heredoc.Doc(` + Query the metadata of the fungible collateral used by the perp module. + `, + ), + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.QueryCollateral( + cmd.Context(), &types.QueryCollateralRequest{}, + ) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/perp/v2/client/cli/tx.go b/x/perp/v2/client/cli/tx.go index d45b81696..b45a8b966 100644 --- a/x/perp/v2/client/cli/tx.go +++ b/x/perp/v2/client/cli/tx.go @@ -16,7 +16,7 @@ import ( types "github.com/NibiruChain/nibiru/x/perp/v2/types" ) -func GetTxCmd() *cobra.Command { +func NewTxCmd() *cobra.Command { txCmd := &cobra.Command{ Use: types.ModuleName, Short: "Generalized automated market maker transaction subcommands", diff --git a/x/perp/v2/integration/action/query.go b/x/perp/v2/integration/action/query.go index 604dcbc39..23d2340c9 100644 --- a/x/perp/v2/integration/action/query.go +++ b/x/perp/v2/integration/action/query.go @@ -306,3 +306,33 @@ func CheckPositionStore_NumPositions(num int) QueryPositionStoreChecks { return nil } } + +// --------------------------------------------------------- +// QueryCollateral +// --------------------------------------------------------- + +type queryCollateral struct { + wantDenom string +} + +func (q queryCollateral) Do(app *app.NibiruApp, ctx sdk.Context) (sdk.Context, error, bool) { + queryServer := keeper.NewQuerier(app.PerpKeeperV2) + + resp, _ := queryServer.QueryCollateral(sdk.WrapSDKContext(ctx), &types.QueryCollateralRequest{}) + if resp.CollateralDenom != q.wantDenom { + return ctx, fmt.Errorf( + "expected collateral denom %s, got %s", + q.wantDenom, + resp.CollateralDenom, + ), false + } + + return ctx, nil, false +} + +// QueryCollateral: Action for the Query/Collateral gRPC query. +func QueryCollateral(expectDenom string) action.Action { + return queryCollateral{ + wantDenom: expectDenom, + } +} diff --git a/x/perp/v2/keeper/grpc_query.go b/x/perp/v2/keeper/grpc_query.go index 167262cdc..6ec57c4fb 100644 --- a/x/perp/v2/keeper/grpc_query.go +++ b/x/perp/v2/keeper/grpc_query.go @@ -190,3 +190,13 @@ func (q queryServer) QueryMarkets( return &types.QueryMarketsResponse{AmmMarkets: ammMarkets}, nil } + +func (q queryServer) QueryCollateral( + goCtx context.Context, req *types.QueryCollateralRequest, +) (*types.QueryCollateralResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + denom := q.k.Collateral.GetOr(ctx, "") + return &types.QueryCollateralResponse{ + CollateralDenom: denom, + }, nil +} diff --git a/x/perp/v2/keeper/grpc_query_test.go b/x/perp/v2/keeper/grpc_query_test.go index 671a95330..de30f16b9 100644 --- a/x/perp/v2/keeper/grpc_query_test.go +++ b/x/perp/v2/keeper/grpc_query_test.go @@ -453,3 +453,36 @@ func TestQueryPositionStore(t *testing.T) { NewTestSuite(t).WithTestCases(tc...).Run() } + +func TestQueryCollateral(t *testing.T) { + tc := TestCases{ + TC("state starts as expected with the mock NUSD denomination"). + Given(). + When(). + Then( + QueryCollateral(types.TestingCollateralDenomNUSD), + ), + + TC("expected value returned after collateral denom changes"). + Given(). + When( + SetCollateral(denoms.BTC), + ). + Then( + QueryCollateral(denoms.BTC), + ), + + TC("sanity check: multiple changes"). + Given(). + When( + SetCollateral(denoms.BTC), + SetCollateral(denoms.ETH), + SetCollateral(denoms.SOL), + ). + Then( + QueryCollateral(denoms.SOL), + ), + } + + NewTestSuite(t).WithTestCases(tc...).Run() +} diff --git a/x/perp/v2/module/genesis_test.go b/x/perp/v2/module/genesis_test.go index 08425f5a2..2077ce6ff 100644 --- a/x/perp/v2/module/genesis_test.go +++ b/x/perp/v2/module/genesis_test.go @@ -180,8 +180,8 @@ func TestNewAppModuleBasic(t *testing.T) { appModule.EndBlock(ctx, abci.RequestEndBlock{}) cmds := appModule.GetTxCmd() - require.Len(t, cmds.Commands(), 8) + require.True(t, len(cmds.Commands()) > 0) cmds = appModule.GetQueryCmd() - require.Len(t, cmds.Commands(), 4) + require.True(t, len(cmds.Commands()) > 0) } diff --git a/x/perp/v2/module/module.go b/x/perp/v2/module/module.go index 12195ccca..94027376a 100644 --- a/x/perp/v2/module/module.go +++ b/x/perp/v2/module/module.go @@ -78,12 +78,12 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes( // GetTxCmd returns the capability module's root tx command. func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() + return cli.NewTxCmd() } // GetQueryCmd returns the capability module's root query command. func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() + return cli.NewQueryCmd() } // ---------------------------------------------------------------------------- diff --git a/x/perp/v2/types/query.pb.go b/x/perp/v2/types/query.pb.go index b66a0e70f..a6b75f9b4 100644 --- a/x/perp/v2/types/query.pb.go +++ b/x/perp/v2/types/query.pb.go @@ -33,6 +33,8 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// QueryPositionsRequest: Request type for the +// "nibiru.perp.v2.Query/Positions" gRPC service method type QueryPositionsRequest struct { Trader string `protobuf:"bytes,1,opt,name=trader,proto3" json:"trader,omitempty"` } @@ -77,6 +79,8 @@ func (m *QueryPositionsRequest) GetTrader() string { return "" } +// QueryPositionsResponse: Response type for the +// "nibiru.perp.v2.Query/Positions" gRPC service method type QueryPositionsResponse struct { Positions []QueryPositionResponse `protobuf:"bytes,1,rep,name=positions,proto3" json:"positions"` } @@ -121,6 +125,8 @@ func (m *QueryPositionsResponse) GetPositions() []QueryPositionResponse { return nil } +// QueryPositionStoreRequest: Request type for the +// "nibiru.perp.v2.Query/PositionStore" gRPC service method type QueryPositionStoreRequest struct { // pagination defines a paginated request Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` @@ -166,6 +172,8 @@ func (m *QueryPositionStoreRequest) GetPagination() *query.PageRequest { return nil } +// QueryPositionStoreResponse: Response type for the +// "nibiru.perp.v2.Query/PositionStore" gRPC service method type QueryPositionStoreResponse struct { // Position responses: collection of all stored positions (with pagination) Positions []Position `protobuf:"bytes,1,rep,name=positions,proto3" json:"positions"` @@ -220,8 +228,8 @@ func (m *QueryPositionStoreResponse) GetPagination() *query.PageResponse { return nil } -// QueryPositionRequest is the request type for the position of the x/perp -// module account. +// QueryPositionRequest: Request type for the +// "nibiru.perp.v2.Query/Position" gRPC service method type QueryPositionRequest 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"` Trader string `protobuf:"bytes,2,opt,name=trader,proto3" json:"trader,omitempty"` @@ -267,6 +275,8 @@ func (m *QueryPositionRequest) GetTrader() string { return "" } +// QueryPositionResponse: Response type for the +// "nibiru.perp.v2.Query/Position" gRPC service method type QueryPositionResponse struct { // The position as it exists in the blockchain state Position Position `protobuf:"bytes,1,opt,name=position,proto3" json:"position"` @@ -319,6 +329,8 @@ func (m *QueryPositionResponse) GetPosition() Position { return Position{} } +// QueryModuleAccountsRequest: Request type for the +// "nibiru.perp.v2.Query/ModuleAccounts" gRPC service method type QueryModuleAccountsRequest struct { } @@ -355,6 +367,8 @@ func (m *QueryModuleAccountsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryModuleAccountsRequest proto.InternalMessageInfo +// QueryModuleAccountsResponse: Response type for the +// "nibiru.perp.v2.Query/ModuleAccounts" gRPC service method type QueryModuleAccountsResponse struct { Accounts []AccountWithBalance `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts"` } @@ -599,6 +613,90 @@ func (m *QueryMarketsResponse) GetAmmMarkets() []AmmMarket { return nil } +// QueryCollateralRequest: Request type for the +// "nibiru.perp.v2.Query/Collateral" gRPC service method +type QueryCollateralRequest struct { +} + +func (m *QueryCollateralRequest) Reset() { *m = QueryCollateralRequest{} } +func (m *QueryCollateralRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCollateralRequest) ProtoMessage() {} +func (*QueryCollateralRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_fc8f0be94fac333f, []int{12} +} +func (m *QueryCollateralRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCollateralRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCollateralRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCollateralRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCollateralRequest.Merge(m, src) +} +func (m *QueryCollateralRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCollateralRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCollateralRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCollateralRequest proto.InternalMessageInfo + +// QueryCollateralRequest: Response type for the +// "nibiru.perp.v2.Query/Collateral" gRPC service method +type QueryCollateralResponse struct { + CollateralDenom string `protobuf:"bytes,1,opt,name=collateral_denom,json=collateralDenom,proto3" json:"collateral_denom,omitempty"` +} + +func (m *QueryCollateralResponse) Reset() { *m = QueryCollateralResponse{} } +func (m *QueryCollateralResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCollateralResponse) ProtoMessage() {} +func (*QueryCollateralResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_fc8f0be94fac333f, []int{13} +} +func (m *QueryCollateralResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCollateralResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCollateralResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCollateralResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCollateralResponse.Merge(m, src) +} +func (m *QueryCollateralResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCollateralResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCollateralResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCollateralResponse proto.InternalMessageInfo + +func (m *QueryCollateralResponse) GetCollateralDenom() string { + if m != nil { + return m.CollateralDenom + } + return "" +} + func init() { proto.RegisterType((*QueryPositionsRequest)(nil), "nibiru.perp.v2.QueryPositionsRequest") proto.RegisterType((*QueryPositionsResponse)(nil), "nibiru.perp.v2.QueryPositionsResponse") @@ -612,69 +710,75 @@ func init() { proto.RegisterType((*AmmMarket)(nil), "nibiru.perp.v2.AmmMarket") proto.RegisterType((*QueryMarketsRequest)(nil), "nibiru.perp.v2.QueryMarketsRequest") proto.RegisterType((*QueryMarketsResponse)(nil), "nibiru.perp.v2.QueryMarketsResponse") + proto.RegisterType((*QueryCollateralRequest)(nil), "nibiru.perp.v2.QueryCollateralRequest") + proto.RegisterType((*QueryCollateralResponse)(nil), "nibiru.perp.v2.QueryCollateralResponse") } func init() { proto.RegisterFile("nibiru/perp/v2/query.proto", fileDescriptor_fc8f0be94fac333f) } var fileDescriptor_fc8f0be94fac333f = []byte{ - // 904 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4f, 0x8f, 0xdb, 0x44, - 0x14, 0x5f, 0xef, 0x6e, 0xb7, 0xbb, 0x6f, 0xdb, 0x15, 0x4c, 0xcb, 0xe2, 0xb8, 0x2b, 0x27, 0x35, - 0x25, 0x5d, 0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 0x73, 0x0b, 0xd0, 0xfc, - 0xf1, 0x8d, 0x3e, 0x3a, 0x33, 0xc3, 0xec, 0x45, 0xe2, 0xdc, 0x58, 0x05, 0xaa, 0x09, 0x35, 0x15, - 0xa1, 0x06, 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, + // 968 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4f, 0x6f, 0xdc, 0x44, + 0x14, 0x8f, 0x93, 0x90, 0x26, 0x2f, 0x6d, 0x5a, 0xa6, 0x25, 0xf5, 0xba, 0xd1, 0x6e, 0x6a, 0x4a, + 0x92, 0xb6, 0xaa, 0x4d, 0xb6, 0x5c, 0x40, 0x1c, 0xe8, 0x26, 0xa2, 0xe2, 0xb0, 0x55, 0x6a, 0x84, + 0x40, 0x70, 0x58, 0xcd, 0x7a, 0x47, 0x1b, 0xab, 0xf6, 0x8c, 0xeb, 0xf1, 0x46, 0xb4, 0x12, 0x1c, + 0x7a, 0xe0, 0x8c, 0xe8, 0x47, 0xe0, 0x04, 0x9f, 0x81, 0x0f, 0xd0, 0x63, 0x25, 0x2e, 0xa8, 0x87, + 0x82, 0x12, 0x3e, 0x48, 0xe5, 0xf1, 0x1b, 0xef, 0xda, 0xde, 0x66, 0xa3, 0x9e, 0x76, 0x3c, 0xef, + 0xf7, 0xde, 0xfb, 0xbd, 0xbf, 0xb3, 0x60, 0xf1, 0xa0, 0x1f, 0x24, 0x23, 0x37, 0x66, 0x49, 0xec, + 0x1e, 0xb5, 0xdd, 0xc7, 0x23, 0x96, 0x3c, 0x71, 0xe2, 0x44, 0xa4, 0x82, 0xac, 0xe5, 0x32, 0x27, + 0x93, 0x39, 0x47, 0x6d, 0xeb, 0xca, 0x50, 0x0c, 0x85, 0x12, 0xb9, 0xd9, 0x29, 0x47, 0x59, 0x1b, + 0x43, 0x21, 0x86, 0x21, 0x73, 0x69, 0x1c, 0xb8, 0x94, 0x73, 0x91, 0xd2, 0x34, 0x10, 0x5c, 0xa2, + 0xb4, 0x6a, 0x5f, 0xa6, 0x34, 0x65, 0x28, 0x6b, 0xfa, 0x42, 0x46, 0x42, 0xba, 0x7d, 0x2a, 0x99, + 0x7b, 0xb4, 0xdb, 0x67, 0x29, 0xdd, 0x75, 0x7d, 0x11, 0x70, 0x94, 0xdf, 0x9a, 0x94, 0x2b, 0x62, + 0x05, 0x2a, 0xa6, 0xc3, 0x80, 0x2b, 0x47, 0x39, 0xd6, 0x76, 0xe1, 0x83, 0x87, 0x19, 0xe2, 0x40, + 0xc8, 0x40, 0xf9, 0xf7, 0xd8, 0xe3, 0x11, 0x93, 0x29, 0x59, 0x87, 0xa5, 0x34, 0xa1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f, 0xa4, 0xfe, 0x99, 0xdd, 0x7d, 0x13, 0x00, 0x00, 0xff, 0xff, + 0x87, 0x56, 0xd6, 0x1b, 0x63, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -689,13 +793,18 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { + // QueryPosition: Query one position on the given market for a user QueryPosition(ctx context.Context, in *QueryPositionRequest, opts ...grpc.CallOption) (*QueryPositionResponse, error) + // QueryPositions: Query all positions for a user QueryPositions(ctx context.Context, in *QueryPositionsRequest, opts ...grpc.CallOption) (*QueryPositionsResponse, error) // QueryPositionStore queries all of the positions in the KV store. QueryPositionStore(ctx context.Context, in *QueryPositionStoreRequest, opts ...grpc.CallOption) (*QueryPositionStoreResponse, error) - // Queries the reserve assets in a given pool, identified by a token pair. + // Queries the module accounts for x/perp ModuleAccounts(ctx context.Context, in *QueryModuleAccountsRequest, opts ...grpc.CallOption) (*QueryModuleAccountsResponse, error) + // QueryMarkets: Query all markets QueryMarkets(ctx context.Context, in *QueryMarketsRequest, opts ...grpc.CallOption) (*QueryMarketsResponse, error) + // QueryCollateral: Queries info about the collateral + QueryCollateral(ctx context.Context, in *QueryCollateralRequest, opts ...grpc.CallOption) (*QueryCollateralResponse, error) } type queryClient struct { @@ -751,15 +860,29 @@ func (c *queryClient) QueryMarkets(ctx context.Context, in *QueryMarketsRequest, return out, nil } +func (c *queryClient) QueryCollateral(ctx context.Context, in *QueryCollateralRequest, opts ...grpc.CallOption) (*QueryCollateralResponse, error) { + out := new(QueryCollateralResponse) + err := c.cc.Invoke(ctx, "/nibiru.perp.v2.Query/QueryCollateral", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { + // QueryPosition: Query one position on the given market for a user QueryPosition(context.Context, *QueryPositionRequest) (*QueryPositionResponse, error) + // QueryPositions: Query all positions for a user QueryPositions(context.Context, *QueryPositionsRequest) (*QueryPositionsResponse, error) // QueryPositionStore queries all of the positions in the KV store. QueryPositionStore(context.Context, *QueryPositionStoreRequest) (*QueryPositionStoreResponse, error) - // Queries the reserve assets in a given pool, identified by a token pair. + // Queries the module accounts for x/perp ModuleAccounts(context.Context, *QueryModuleAccountsRequest) (*QueryModuleAccountsResponse, error) + // QueryMarkets: Query all markets QueryMarkets(context.Context, *QueryMarketsRequest) (*QueryMarketsResponse, error) + // QueryCollateral: Queries info about the collateral + QueryCollateral(context.Context, *QueryCollateralRequest) (*QueryCollateralResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -781,6 +904,9 @@ func (*UnimplementedQueryServer) ModuleAccounts(ctx context.Context, req *QueryM func (*UnimplementedQueryServer) QueryMarkets(ctx context.Context, req *QueryMarketsRequest) (*QueryMarketsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryMarkets not implemented") } +func (*UnimplementedQueryServer) QueryCollateral(ctx context.Context, req *QueryCollateralRequest) (*QueryCollateralResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryCollateral not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -876,6 +1002,24 @@ func _Query_QueryMarkets_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Query_QueryCollateral_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCollateralRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryCollateral(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/nibiru.perp.v2.Query/QueryCollateral", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryCollateral(ctx, req.(*QueryCollateralRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "nibiru.perp.v2.Query", HandlerType: (*QueryServer)(nil), @@ -900,6 +1044,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryMarkets", Handler: _Query_QueryMarkets_Handler, }, + { + MethodName: "QueryCollateral", + Handler: _Query_QueryCollateral_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "nibiru/perp/v2/query.proto", @@ -1383,6 +1531,59 @@ func (m *QueryMarketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryCollateralRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCollateralRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCollateralRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryCollateralResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCollateralResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCollateralResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CollateralDenom) > 0 { + i -= len(m.CollateralDenom) + copy(dAtA[i:], m.CollateralDenom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.CollateralDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1573,6 +1774,28 @@ func (m *QueryMarketsResponse) Size() (n int) { return n } +func (m *QueryCollateralRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryCollateralResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CollateralDenom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2804,6 +3027,138 @@ func (m *QueryMarketsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryCollateralRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCollateralRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCollateralRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCollateralResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCollateralResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCollateralResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CollateralDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/perp/v2/types/query.pb.gw.go b/x/perp/v2/types/query.pb.gw.go index d7f2bee0d..d4ffdef8e 100644 --- a/x/perp/v2/types/query.pb.gw.go +++ b/x/perp/v2/types/query.pb.gw.go @@ -195,6 +195,24 @@ func local_request_Query_QueryMarkets_0(ctx context.Context, marshaler runtime.M } +func request_Query_QueryCollateral_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCollateralRequest + var metadata runtime.ServerMetadata + + msg, err := client.QueryCollateral(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryCollateral_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCollateralRequest + var metadata runtime.ServerMetadata + + msg, err := server.QueryCollateral(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -316,6 +334,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryCollateral_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryCollateral_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryCollateral_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -457,6 +498,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryCollateral_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryCollateral_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryCollateral_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -470,6 +531,8 @@ var ( pattern_Query_ModuleAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"nibiru", "perp", "v2", "module_accounts"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryMarkets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"nibiru", "perp", "v2", "markets"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryCollateral_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"nibiru", "perp", "v2", "collateral"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -482,4 +545,6 @@ var ( forward_Query_ModuleAccounts_0 = runtime.ForwardResponseMessage forward_Query_QueryMarkets_0 = runtime.ForwardResponseMessage + + forward_Query_QueryCollateral_0 = runtime.ForwardResponseMessage )