From 4c505c9d1eae6c93df40353f9f66762892d7ef16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDongLieu=E2=80=9D?= Date: Tue, 12 Nov 2024 14:56:41 +0700 Subject: [PATCH] add querry collateral for vaults --- proto/reserve/vaults/query.proto | 27 +- x/oracle/client/cli/query.go | 4 +- x/vaults/cli/query.go | 45 +- x/vaults/keeper/query.go | 33 + x/vaults/types/query.pb.go | 1057 ++++++++++++++++++++++++++---- x/vaults/types/query.pb.gw.go | 166 +++++ 6 files changed, 1217 insertions(+), 115 deletions(-) diff --git a/proto/reserve/vaults/query.proto b/proto/reserve/vaults/query.proto index d7dd47e..cd11aea 100644 --- a/proto/reserve/vaults/query.proto +++ b/proto/reserve/vaults/query.proto @@ -20,7 +20,15 @@ service Query { option (google.api.http).get = "/reserve/vaults/params"; } - rpc QueryCollateralsByDenom(QueryCollateralsByDenomRequest) returns (QueryCollateralsByDenomResponse){ + rpc QueryCollateralsByDenom(QueryCollateralsByDenomRequest) returns (QueryCollateralsByDenomResponse){ + option (google.api.http).get = "/reserve/vaults/params"; + } + + rpc QueryCollateralsByMintDenom(QueryCollateralsByMintDenomRequest) returns (QueryCollateralsByMintDenomResponse){ + option (google.api.http).get = "/reserve/vaults/params"; + } + + rpc QueryCollateralsByDenomMintDenom(QueryCollateralsByDenomMintDenomRequest) returns (QueryCollateralsByDenomMintDenomResponse){ option (google.api.http).get = "/reserve/vaults/params"; } @@ -76,6 +84,23 @@ message QueryCollateralsByDenomResponse{ repeated VaultMamager all_vault_mamager_by_denom = 1; } +message QueryCollateralsByMintDenomRequest { + string mint_denom = 1; +} + +message QueryCollateralsByMintDenomResponse{ + repeated VaultMamager all_vault_mamager_by_mint_denom = 1; +} + +message QueryCollateralsByDenomMintDenomRequest { + string denom = 1; + string mint_denom = 2; +} + +message QueryCollateralsByDenomMintDenomResponse{ + VaultMamager vault_mamager = 1; +} + message QueryVaultByOwnerRequest { string address = 1; } diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index c97aa96..573bdae 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -187,8 +187,8 @@ func GetBandOracleRequest() *cobra.Command { func GetQueryOracleScriptIdByDenomCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "oracle-scriptId-by-denom [denom]", - Short: "Get oracle-scriptId by denom", + Use: "oracle-scriptId-by-symbol [symbol]", + Short: "Get oracle-scriptId by symbol", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) diff --git a/x/vaults/cli/query.go b/x/vaults/cli/query.go index 2410cc3..ec88e89 100644 --- a/x/vaults/cli/query.go +++ b/x/vaults/cli/query.go @@ -56,7 +56,7 @@ func CmdQueryAllCollateral() *cobra.Command { func CmdQueryCollateralsByDenom() *cobra.Command { cmd := &cobra.Command{ Use: "collateral-by-denom [denom]", - Short: "show all collateral", + Short: "show all collateral by denom", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) @@ -75,6 +75,49 @@ func CmdQueryCollateralsByDenom() *cobra.Command { return cmd } +func CmdQueryCollateralsByMintDenom() *cobra.Command { + cmd := &cobra.Command{ + Use: "collateral-by-mint-denom [mint-denom]", + Short: "show all collateral by mint denom", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.QueryCollateralsByMintDenom(context.Background(), &types.QueryCollateralsByMintDenomRequest{MintDenom: args[0]}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} +func CmdQueryCollateralsByDenomMintDenom() *cobra.Command { + cmd := &cobra.Command{ + Use: "collateral-by-denom [denom] [mint-denom]", + Short: "show collateral by denom and mint denom", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.QueryCollateralsByDenomMintDenom(context.Background(), &types.QueryCollateralsByDenomMintDenomRequest{Denom: args[0], MintDenom: args[1]}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + func CmdQueryAllVaults() *cobra.Command { cmd := &cobra.Command{ Use: "all-vaults", diff --git a/x/vaults/keeper/query.go b/x/vaults/keeper/query.go index 106e303..346b88f 100644 --- a/x/vaults/keeper/query.go +++ b/x/vaults/keeper/query.go @@ -63,6 +63,39 @@ func (q queryServer) QueryCollateralsByDenom(ctx context.Context, req *types.Que }, err } +func (q queryServer) QueryCollateralsByMintDenom(ctx context.Context, req *types.QueryCollateralsByMintDenomRequest) (*types.QueryCollateralsByMintDenomResponse, error) { + allCollateral := []*types.VaultMamager{} + + err := q.keeper.VaultsManager.Walk(ctx, nil, func(key string, value types.VaultMamager) (stop bool, err error) { + if value.Params.MintDenom == req.MintDenom { + allCollateral = append(allCollateral, &value) + } + + return false, nil + }) + + return &types.QueryCollateralsByMintDenomResponse{ + AllVaultMamagerByMintDenom: allCollateral, + }, err +} + +func (q queryServer) QueryCollateralsByDenomMintDenom(ctx context.Context, req *types.QueryCollateralsByDenomMintDenomRequest) (*types.QueryCollateralsByDenomMintDenomResponse, error) { + var collateral *types.VaultMamager + + err := q.keeper.VaultsManager.Walk(ctx, nil, func(key string, value types.VaultMamager) (stop bool, err error) { + if value.Denom == req.Denom && value.Params.MintDenom == req.MintDenom { + collateral = &value + return true, nil + } + + return false, nil + }) + + return &types.QueryCollateralsByDenomMintDenomResponse{ + VaultMamager: collateral, + }, err +} + func (q queryServer) QueryAllVaults(ctx context.Context, req *types.QueryAllVaultsRequest) (*types.QueryAllVaultsResponse, error) { allVaults := []*types.Vault{} diff --git a/x/vaults/types/query.pb.go b/x/vaults/types/query.pb.go index f306b60..ef041ca 100644 --- a/x/vaults/types/query.pb.go +++ b/x/vaults/types/query.pb.go @@ -450,6 +450,194 @@ func (m *QueryCollateralsByDenomResponse) GetAllVaultMamagerByDenom() []*VaultMa return nil } +type QueryCollateralsByMintDenomRequest struct { + MintDenom string `protobuf:"bytes,1,opt,name=mint_denom,json=mintDenom,proto3" json:"mint_denom,omitempty"` +} + +func (m *QueryCollateralsByMintDenomRequest) Reset() { *m = QueryCollateralsByMintDenomRequest{} } +func (m *QueryCollateralsByMintDenomRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCollateralsByMintDenomRequest) ProtoMessage() {} +func (*QueryCollateralsByMintDenomRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5eedd1d3c0c88e0e, []int{10} +} +func (m *QueryCollateralsByMintDenomRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCollateralsByMintDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCollateralsByMintDenomRequest.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 *QueryCollateralsByMintDenomRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCollateralsByMintDenomRequest.Merge(m, src) +} +func (m *QueryCollateralsByMintDenomRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCollateralsByMintDenomRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCollateralsByMintDenomRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCollateralsByMintDenomRequest proto.InternalMessageInfo + +func (m *QueryCollateralsByMintDenomRequest) GetMintDenom() string { + if m != nil { + return m.MintDenom + } + return "" +} + +type QueryCollateralsByMintDenomResponse struct { + AllVaultMamagerByMintDenom []*VaultMamager `protobuf:"bytes,1,rep,name=all_vault_mamager_by_mint_denom,json=allVaultMamagerByMintDenom,proto3" json:"all_vault_mamager_by_mint_denom,omitempty"` +} + +func (m *QueryCollateralsByMintDenomResponse) Reset() { *m = QueryCollateralsByMintDenomResponse{} } +func (m *QueryCollateralsByMintDenomResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCollateralsByMintDenomResponse) ProtoMessage() {} +func (*QueryCollateralsByMintDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5eedd1d3c0c88e0e, []int{11} +} +func (m *QueryCollateralsByMintDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCollateralsByMintDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCollateralsByMintDenomResponse.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 *QueryCollateralsByMintDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCollateralsByMintDenomResponse.Merge(m, src) +} +func (m *QueryCollateralsByMintDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCollateralsByMintDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCollateralsByMintDenomResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCollateralsByMintDenomResponse proto.InternalMessageInfo + +func (m *QueryCollateralsByMintDenomResponse) GetAllVaultMamagerByMintDenom() []*VaultMamager { + if m != nil { + return m.AllVaultMamagerByMintDenom + } + return nil +} + +type QueryCollateralsByDenomMintDenomRequest struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + MintDenom string `protobuf:"bytes,2,opt,name=mint_denom,json=mintDenom,proto3" json:"mint_denom,omitempty"` +} + +func (m *QueryCollateralsByDenomMintDenomRequest) Reset() { + *m = QueryCollateralsByDenomMintDenomRequest{} +} +func (m *QueryCollateralsByDenomMintDenomRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCollateralsByDenomMintDenomRequest) ProtoMessage() {} +func (*QueryCollateralsByDenomMintDenomRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5eedd1d3c0c88e0e, []int{12} +} +func (m *QueryCollateralsByDenomMintDenomRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCollateralsByDenomMintDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCollateralsByDenomMintDenomRequest.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 *QueryCollateralsByDenomMintDenomRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCollateralsByDenomMintDenomRequest.Merge(m, src) +} +func (m *QueryCollateralsByDenomMintDenomRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCollateralsByDenomMintDenomRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCollateralsByDenomMintDenomRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCollateralsByDenomMintDenomRequest proto.InternalMessageInfo + +func (m *QueryCollateralsByDenomMintDenomRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *QueryCollateralsByDenomMintDenomRequest) GetMintDenom() string { + if m != nil { + return m.MintDenom + } + return "" +} + +type QueryCollateralsByDenomMintDenomResponse struct { + VaultMamager *VaultMamager `protobuf:"bytes,1,opt,name=vault_mamager,json=vaultMamager,proto3" json:"vault_mamager,omitempty"` +} + +func (m *QueryCollateralsByDenomMintDenomResponse) Reset() { + *m = QueryCollateralsByDenomMintDenomResponse{} +} +func (m *QueryCollateralsByDenomMintDenomResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCollateralsByDenomMintDenomResponse) ProtoMessage() {} +func (*QueryCollateralsByDenomMintDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5eedd1d3c0c88e0e, []int{13} +} +func (m *QueryCollateralsByDenomMintDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCollateralsByDenomMintDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCollateralsByDenomMintDenomResponse.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 *QueryCollateralsByDenomMintDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCollateralsByDenomMintDenomResponse.Merge(m, src) +} +func (m *QueryCollateralsByDenomMintDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCollateralsByDenomMintDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCollateralsByDenomMintDenomResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCollateralsByDenomMintDenomResponse proto.InternalMessageInfo + +func (m *QueryCollateralsByDenomMintDenomResponse) GetVaultMamager() *VaultMamager { + if m != nil { + return m.VaultMamager + } + return nil +} + type QueryVaultByOwnerRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } @@ -458,7 +646,7 @@ func (m *QueryVaultByOwnerRequest) Reset() { *m = QueryVaultByOwnerReque func (m *QueryVaultByOwnerRequest) String() string { return proto.CompactTextString(m) } func (*QueryVaultByOwnerRequest) ProtoMessage() {} func (*QueryVaultByOwnerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5eedd1d3c0c88e0e, []int{10} + return fileDescriptor_5eedd1d3c0c88e0e, []int{14} } func (m *QueryVaultByOwnerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -502,7 +690,7 @@ func (m *QueryVaultByOwnerResponse) Reset() { *m = QueryVaultByOwnerResp func (m *QueryVaultByOwnerResponse) String() string { return proto.CompactTextString(m) } func (*QueryVaultByOwnerResponse) ProtoMessage() {} func (*QueryVaultByOwnerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5eedd1d3c0c88e0e, []int{11} + return fileDescriptor_5eedd1d3c0c88e0e, []int{15} } func (m *QueryVaultByOwnerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -549,6 +737,10 @@ func init() { proto.RegisterType((*QueryAllCollateralResponse)(nil), "reserve.vaults.QueryAllCollateralResponse") proto.RegisterType((*QueryCollateralsByDenomRequest)(nil), "reserve.vaults.QueryCollateralsByDenomRequest") proto.RegisterType((*QueryCollateralsByDenomResponse)(nil), "reserve.vaults.QueryCollateralsByDenomResponse") + proto.RegisterType((*QueryCollateralsByMintDenomRequest)(nil), "reserve.vaults.QueryCollateralsByMintDenomRequest") + proto.RegisterType((*QueryCollateralsByMintDenomResponse)(nil), "reserve.vaults.QueryCollateralsByMintDenomResponse") + proto.RegisterType((*QueryCollateralsByDenomMintDenomRequest)(nil), "reserve.vaults.QueryCollateralsByDenomMintDenomRequest") + proto.RegisterType((*QueryCollateralsByDenomMintDenomResponse)(nil), "reserve.vaults.QueryCollateralsByDenomMintDenomResponse") proto.RegisterType((*QueryVaultByOwnerRequest)(nil), "reserve.vaults.QueryVaultByOwnerRequest") proto.RegisterType((*QueryVaultByOwnerResponse)(nil), "reserve.vaults.QueryVaultByOwnerResponse") } @@ -556,48 +748,56 @@ func init() { func init() { proto.RegisterFile("reserve/vaults/query.proto", fileDescriptor_5eedd1d3c0c88e0e) } var fileDescriptor_5eedd1d3c0c88e0e = []byte{ - // 645 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4f, 0x6b, 0xd4, 0x40, - 0x14, 0xdf, 0xa8, 0xdd, 0xb6, 0x4f, 0x68, 0xe9, 0xb8, 0xdd, 0x6e, 0xd3, 0x92, 0xca, 0xf8, 0x87, - 0xb6, 0x62, 0xc6, 0x56, 0x11, 0x3c, 0xba, 0xed, 0xc1, 0x8a, 0x62, 0xcd, 0x41, 0xc4, 0xcb, 0x32, -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f, 0xb4, 0x6a, 0xbf, 0x0e, 0xad, 0xda, 0x0b, 0xe2, 0x7a, 0xc9, 0xab, 0x7e, 0xd7, 0xde, - 0xe1, 0x01, 0xe1, 0x21, 0x0f, 0x52, 0xf9, 0x91, 0xd9, 0xe1, 0xfe, 0x91, 0xd2, 0x9b, 0x4c, 0x2b, - 0x49, 0x23, 0x26, 0xba, 0x75, 0x09, 0xb8, 0xfd, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x0a, 0xb1, 0xf2, - 0x3e, 0x43, 0x07, 0x00, 0x00, + // 770 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4d, 0x4f, 0x13, 0x41, + 0x18, 0xee, 0xa2, 0x14, 0xfa, 0xaa, 0x10, 0xc6, 0x52, 0xca, 0x82, 0x0b, 0x19, 0xfc, 0x00, 0x8c, + 0x5d, 0x29, 0xc6, 0x8f, 0x23, 0x85, 0x83, 0x18, 0x89, 0xd8, 0x83, 0x31, 0x1e, 0x6c, 0xa6, 0x74, + 0xac, 0x9b, 0xec, 0xee, 0x94, 0x9d, 0x6d, 0xb5, 0xd1, 0xc4, 0xc4, 0x13, 0x89, 0x17, 0x12, 0x6f, + 0xfe, 0x00, 0xe3, 0xd1, 0x8b, 0xff, 0x81, 0x23, 0x89, 0x17, 0x4f, 0xc6, 0x80, 0x89, 0x7f, 0xc3, + 0x74, 0x76, 0xb6, 0xb0, 0xdb, 0x6d, 0x77, 0xb9, 0x34, 0xbb, 0x33, 0xcf, 0xfb, 0x7c, 0xcc, 0xee, + 0xfb, 0x6e, 0x41, 0x75, 0x28, 0xa7, 0x4e, 0x8b, 0xea, 0x2d, 0xd2, 0x34, 0x5d, 0xae, 0xef, 0x36, + 0xa9, 0xd3, 0x2e, 0x34, 0x1c, 0xe6, 0x32, 0x34, 0x26, 0xf7, 0x0a, 0xde, 0x9e, 0x3a, 0x41, 0x2c, + 0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0xaf, 0x0e, 0x06, 0x25, 0x54, 0xdf, 0x53, 0x60, 0xa2, 0x67, 0xa8, 0xa0, + 0xc5, 0xfe, 0xdc, 0xc1, 0x69, 0xa5, 0x2e, 0x25, 0x40, 0x26, 0xb3, 0x52, 0xda, 0x3c, 0x38, 0xd2, + 0x94, 0xc3, 0x23, 0x4d, 0xf9, 0x73, 0xa4, 0x29, 0xfb, 0xc7, 0x5a, 0xea, 0xf0, 0x58, 0x4b, 0xfd, + 0x3a, 0xd6, 0x52, 0x2f, 0xf4, 0xba, 0xe1, 0xbe, 0x6e, 0x56, 0x0b, 0x3b, 0xcc, 0xd2, 0x99, 0xcd, + 0xac, 0xb6, 0xf8, 0x93, 0xb5, 0xc3, 0xcc, 0x2e, 0xd3, 0x5b, 0x9f, 0xcb, 0x6d, 0x37, 0x28, 0xaf, + 0xa6, 0x05, 0x60, 0xf5, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x84, 0x26, 0x9e, 0x8f, 0x43, 0x0a, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -616,6 +816,8 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) QueryAllCollateral(ctx context.Context, in *QueryAllCollateralRequest, opts ...grpc.CallOption) (*QueryAllCollateralResponse, error) QueryCollateralsByDenom(ctx context.Context, in *QueryCollateralsByDenomRequest, opts ...grpc.CallOption) (*QueryCollateralsByDenomResponse, error) + QueryCollateralsByMintDenom(ctx context.Context, in *QueryCollateralsByMintDenomRequest, opts ...grpc.CallOption) (*QueryCollateralsByMintDenomResponse, error) + QueryCollateralsByDenomMintDenom(ctx context.Context, in *QueryCollateralsByDenomMintDenomRequest, opts ...grpc.CallOption) (*QueryCollateralsByDenomMintDenomResponse, error) QueryAllVaults(ctx context.Context, in *QueryAllVaultsRequest, opts ...grpc.CallOption) (*QueryAllVaultsResponse, error) QueryVaultsByID(ctx context.Context, in *QueryVaultIdRequest, opts ...grpc.CallOption) (*QueryVaultIdResponse, error) QueryVaultByOwner(ctx context.Context, in *QueryVaultByOwnerRequest, opts ...grpc.CallOption) (*QueryVaultByOwnerResponse, error) @@ -656,6 +858,24 @@ func (c *queryClient) QueryCollateralsByDenom(ctx context.Context, in *QueryColl return out, nil } +func (c *queryClient) QueryCollateralsByMintDenom(ctx context.Context, in *QueryCollateralsByMintDenomRequest, opts ...grpc.CallOption) (*QueryCollateralsByMintDenomResponse, error) { + out := new(QueryCollateralsByMintDenomResponse) + err := c.cc.Invoke(ctx, "/reserve.vaults.Query/QueryCollateralsByMintDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryCollateralsByDenomMintDenom(ctx context.Context, in *QueryCollateralsByDenomMintDenomRequest, opts ...grpc.CallOption) (*QueryCollateralsByDenomMintDenomResponse, error) { + out := new(QueryCollateralsByDenomMintDenomResponse) + err := c.cc.Invoke(ctx, "/reserve.vaults.Query/QueryCollateralsByDenomMintDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) QueryAllVaults(ctx context.Context, in *QueryAllVaultsRequest, opts ...grpc.CallOption) (*QueryAllVaultsResponse, error) { out := new(QueryAllVaultsResponse) err := c.cc.Invoke(ctx, "/reserve.vaults.Query/QueryAllVaults", in, out, opts...) @@ -689,6 +909,8 @@ type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) QueryAllCollateral(context.Context, *QueryAllCollateralRequest) (*QueryAllCollateralResponse, error) QueryCollateralsByDenom(context.Context, *QueryCollateralsByDenomRequest) (*QueryCollateralsByDenomResponse, error) + QueryCollateralsByMintDenom(context.Context, *QueryCollateralsByMintDenomRequest) (*QueryCollateralsByMintDenomResponse, error) + QueryCollateralsByDenomMintDenom(context.Context, *QueryCollateralsByDenomMintDenomRequest) (*QueryCollateralsByDenomMintDenomResponse, error) QueryAllVaults(context.Context, *QueryAllVaultsRequest) (*QueryAllVaultsResponse, error) QueryVaultsByID(context.Context, *QueryVaultIdRequest) (*QueryVaultIdResponse, error) QueryVaultByOwner(context.Context, *QueryVaultByOwnerRequest) (*QueryVaultByOwnerResponse, error) @@ -707,6 +929,12 @@ func (*UnimplementedQueryServer) QueryAllCollateral(ctx context.Context, req *Qu func (*UnimplementedQueryServer) QueryCollateralsByDenom(ctx context.Context, req *QueryCollateralsByDenomRequest) (*QueryCollateralsByDenomResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryCollateralsByDenom not implemented") } +func (*UnimplementedQueryServer) QueryCollateralsByMintDenom(ctx context.Context, req *QueryCollateralsByMintDenomRequest) (*QueryCollateralsByMintDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryCollateralsByMintDenom not implemented") +} +func (*UnimplementedQueryServer) QueryCollateralsByDenomMintDenom(ctx context.Context, req *QueryCollateralsByDenomMintDenomRequest) (*QueryCollateralsByDenomMintDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryCollateralsByDenomMintDenom not implemented") +} func (*UnimplementedQueryServer) QueryAllVaults(ctx context.Context, req *QueryAllVaultsRequest) (*QueryAllVaultsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryAllVaults not implemented") } @@ -775,6 +1003,42 @@ func _Query_QueryCollateralsByDenom_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +func _Query_QueryCollateralsByMintDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCollateralsByMintDenomRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryCollateralsByMintDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/reserve.vaults.Query/QueryCollateralsByMintDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryCollateralsByMintDenom(ctx, req.(*QueryCollateralsByMintDenomRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryCollateralsByDenomMintDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCollateralsByDenomMintDenomRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryCollateralsByDenomMintDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/reserve.vaults.Query/QueryCollateralsByDenomMintDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryCollateralsByDenomMintDenom(ctx, req.(*QueryCollateralsByDenomMintDenomRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_QueryAllVaults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryAllVaultsRequest) if err := dec(in); err != nil { @@ -845,6 +1109,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryCollateralsByDenom", Handler: _Query_QueryCollateralsByDenom_Handler, }, + { + MethodName: "QueryCollateralsByMintDenom", + Handler: _Query_QueryCollateralsByMintDenom_Handler, + }, + { + MethodName: "QueryCollateralsByDenomMintDenom", + Handler: _Query_QueryCollateralsByDenomMintDenom_Handler, + }, { MethodName: "QueryAllVaults", Handler: _Query_QueryAllVaults_Handler, @@ -1168,7 +1440,7 @@ func (m *QueryCollateralsByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } -func (m *QueryVaultByOwnerRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryCollateralsByMintDenomRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1178,27 +1450,27 @@ func (m *QueryVaultByOwnerRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryVaultByOwnerRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryCollateralsByMintDenomRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryVaultByOwnerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryCollateralsByMintDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + if len(m.MintDenom) > 0 { + i -= len(m.MintDenom) + copy(dAtA[i:], m.MintDenom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.MintDenom))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryVaultByOwnerResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryCollateralsByMintDenomResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1208,20 +1480,20 @@ func (m *QueryVaultByOwnerResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryVaultByOwnerResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryCollateralsByMintDenomResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryVaultByOwnerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryCollateralsByMintDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Vaults) > 0 { - for iNdEx := len(m.Vaults) - 1; iNdEx >= 0; iNdEx-- { + if len(m.AllVaultMamagerByMintDenom) > 0 { + for iNdEx := len(m.AllVaultMamagerByMintDenom) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Vaults[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.AllVaultMamagerByMintDenom[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1235,75 +1507,214 @@ func (m *QueryVaultByOwnerResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryCollateralsByDenomMintDenomRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n +func (m *QueryCollateralsByDenomMintDenomRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryVaultIdRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryCollateralsByDenomMintDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.VaultId != 0 { - n += 1 + sovQuery(uint64(m.VaultId)) + if len(m.MintDenom) > 0 { + i -= len(m.MintDenom) + copy(dAtA[i:], m.MintDenom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.MintDenom))) + i-- + dAtA[i] = 0x12 } - return n + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *QueryVaultIdResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Vault != nil { - l = m.Vault.Size() - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryCollateralsByDenomMintDenomResponse) 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 n + return dAtA[:n], nil } -func (m *QueryAllVaultsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n +func (m *QueryCollateralsByDenomMintDenomResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllVaultsResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryCollateralsByDenomMintDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.VaultMamager != nil { + { + size, err := m.VaultMamager.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryVaultByOwnerRequest) 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 *QueryVaultByOwnerRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVaultByOwnerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryVaultByOwnerResponse) 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 *QueryVaultByOwnerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVaultByOwnerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Vaults) > 0 { + for iNdEx := len(m.Vaults) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Vaults[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryVaultIdRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VaultId != 0 { + n += 1 + sovQuery(uint64(m.VaultId)) + } + return n +} + +func (m *QueryVaultIdResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Vault != nil { + l = m.Vault.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllVaultsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryAllVaultsResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.AllVault) > 0 { @@ -1367,6 +1778,64 @@ func (m *QueryCollateralsByDenomResponse) Size() (n int) { return n } +func (m *QueryCollateralsByMintDenomRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MintDenom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCollateralsByMintDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AllVaultMamagerByMintDenom) > 0 { + for _, e := range m.AllVaultMamagerByMintDenom { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryCollateralsByDenomMintDenomRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.MintDenom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCollateralsByDenomMintDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VaultMamager != nil { + l = m.VaultMamager.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QueryVaultByOwnerRequest) Size() (n int) { if m == nil { return 0 @@ -2123,6 +2592,372 @@ func (m *QueryCollateralsByDenomResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryCollateralsByMintDenomRequest) 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: QueryCollateralsByMintDenomRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCollateralsByMintDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintDenom", 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.MintDenom = 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 (m *QueryCollateralsByMintDenomResponse) 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: QueryCollateralsByMintDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCollateralsByMintDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllVaultMamagerByMintDenom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllVaultMamagerByMintDenom = append(m.AllVaultMamagerByMintDenom, &VaultMamager{}) + if err := m.AllVaultMamagerByMintDenom[len(m.AllVaultMamagerByMintDenom)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 (m *QueryCollateralsByDenomMintDenomRequest) 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: QueryCollateralsByDenomMintDenomRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCollateralsByDenomMintDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintDenom", 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.MintDenom = 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 (m *QueryCollateralsByDenomMintDenomResponse) 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: QueryCollateralsByDenomMintDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCollateralsByDenomMintDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VaultMamager", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VaultMamager == nil { + m.VaultMamager = &VaultMamager{} + } + if err := m.VaultMamager.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 (m *QueryVaultByOwnerRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/vaults/types/query.pb.gw.go b/x/vaults/types/query.pb.gw.go index dbe22c5..a44d74e 100644 --- a/x/vaults/types/query.pb.gw.go +++ b/x/vaults/types/query.pb.gw.go @@ -105,6 +105,78 @@ func local_request_Query_QueryCollateralsByDenom_0(ctx context.Context, marshale } +var ( + filter_Query_QueryCollateralsByMintDenom_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryCollateralsByMintDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCollateralsByMintDenomRequest + 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_QueryCollateralsByMintDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryCollateralsByMintDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryCollateralsByMintDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCollateralsByMintDenomRequest + 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_QueryCollateralsByMintDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryCollateralsByMintDenom(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryCollateralsByDenomMintDenom_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryCollateralsByDenomMintDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCollateralsByDenomMintDenomRequest + 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_QueryCollateralsByDenomMintDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryCollateralsByDenomMintDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryCollateralsByDenomMintDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCollateralsByDenomMintDenomRequest + 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_QueryCollateralsByDenomMintDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryCollateralsByDenomMintDenom(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_QueryAllVaults_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryAllVaultsRequest var metadata runtime.ServerMetadata @@ -270,6 +342,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryCollateralsByMintDenom_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_QueryCollateralsByMintDenom_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_QueryCollateralsByMintDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryCollateralsByDenomMintDenom_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_QueryCollateralsByDenomMintDenom_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_QueryCollateralsByDenomMintDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryAllVaults_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -440,6 +558,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryCollateralsByMintDenom_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_QueryCollateralsByMintDenom_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_QueryCollateralsByMintDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryCollateralsByDenomMintDenom_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_QueryCollateralsByDenomMintDenom_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_QueryCollateralsByDenomMintDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryAllVaults_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -510,6 +668,10 @@ var ( pattern_Query_QueryCollateralsByDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"reserve", "vaults", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryCollateralsByMintDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"reserve", "vaults", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryCollateralsByDenomMintDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"reserve", "vaults", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryAllVaults_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"reserve", "vaults", "params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryVaultsByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"reserve", "vaults", "params"}, "", runtime.AssumeColonVerbOpt(false))) @@ -524,6 +686,10 @@ var ( forward_Query_QueryCollateralsByDenom_0 = runtime.ForwardResponseMessage + forward_Query_QueryCollateralsByMintDenom_0 = runtime.ForwardResponseMessage + + forward_Query_QueryCollateralsByDenomMintDenom_0 = runtime.ForwardResponseMessage + forward_Query_QueryAllVaults_0 = runtime.ForwardResponseMessage forward_Query_QueryVaultsByID_0 = runtime.ForwardResponseMessage