diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.ts index 443f43d4ce..5c1bae70b8 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.ts @@ -39,7 +39,6 @@ export interface QueryVaultResponse { equity: Long; inventory: Long; totalShares: Long; - allOwnerShares: OwnerShares[]; } /** QueryVaultResponse is a response type for the Vault RPC method. */ @@ -49,19 +48,6 @@ export interface QueryVaultResponseSDKType { equity: Long; inventory: Long; total_shares: Long; - all_owner_shares: OwnerSharesSDKType[]; -} -/** OwnerShares is a message type for an owner and their shares. */ - -export interface OwnerShares { - owner: string; - shares: Long; -} -/** OwnerShares is a message type for an owner and their shares. */ - -export interface OwnerSharesSDKType { - owner: string; - shares: Long; } function createBaseQueryParamsRequest(): QueryParamsRequest { @@ -204,8 +190,7 @@ function createBaseQueryVaultResponse(): QueryVaultResponse { subaccountId: undefined, equity: Long.UZERO, inventory: Long.UZERO, - totalShares: Long.UZERO, - allOwnerShares: [] + totalShares: Long.UZERO }; } @@ -231,10 +216,6 @@ export const QueryVaultResponse = { writer.uint32(40).uint64(message.totalShares); } - for (const v of message.allOwnerShares) { - OwnerShares.encode(v!, writer.uint32(50).fork()).ldelim(); - } - return writer; }, @@ -267,10 +248,6 @@ export const QueryVaultResponse = { message.totalShares = (reader.uint64() as Long); break; - case 6: - message.allOwnerShares.push(OwnerShares.decode(reader, reader.uint32())); - break; - default: reader.skipType(tag & 7); break; @@ -287,62 +264,6 @@ export const QueryVaultResponse = { message.equity = object.equity !== undefined && object.equity !== null ? Long.fromValue(object.equity) : Long.UZERO; message.inventory = object.inventory !== undefined && object.inventory !== null ? Long.fromValue(object.inventory) : Long.UZERO; message.totalShares = object.totalShares !== undefined && object.totalShares !== null ? Long.fromValue(object.totalShares) : Long.UZERO; - message.allOwnerShares = object.allOwnerShares?.map(e => OwnerShares.fromPartial(e)) || []; - return message; - } - -}; - -function createBaseOwnerShares(): OwnerShares { - return { - owner: "", - shares: Long.UZERO - }; -} - -export const OwnerShares = { - encode(message: OwnerShares, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.owner !== "") { - writer.uint32(10).string(message.owner); - } - - if (!message.shares.isZero()) { - writer.uint32(16).uint64(message.shares); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): OwnerShares { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOwnerShares(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.owner = reader.string(); - break; - - case 2: - message.shares = (reader.uint64() as Long); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): OwnerShares { - const message = createBaseOwnerShares(); - message.owner = object.owner ?? ""; - message.shares = object.shares !== undefined && object.shares !== null ? Long.fromValue(object.shares) : Long.UZERO; return message; } diff --git a/proto/dydxprotocol/vault/query.proto b/proto/dydxprotocol/vault/query.proto index 8ad0b6f05e..019a07acb5 100644 --- a/proto/dydxprotocol/vault/query.proto +++ b/proto/dydxprotocol/vault/query.proto @@ -17,7 +17,8 @@ service Query { } // Queries a Vault by type and number. rpc Vault(QueryVaultRequest) returns (QueryVaultResponse) { - option (google.api.http).get = "/dydxprotocol/v4/vault/vaults/{type}/{number}"; + option (google.api.http).get = + "/dydxprotocol/v4/vault/vaults/{type}/{number}"; } } @@ -43,11 +44,4 @@ message QueryVaultResponse { uint64 equity = 3; uint64 inventory = 4; uint64 total_shares = 5; - repeated OwnerShares all_owner_shares = 6 [ (gogoproto.nullable) = false ]; -} - -// OwnerShares is a message type for an owner and their shares. -message OwnerShares { - string owner = 1; - uint64 shares = 2; } diff --git a/protocol/x/vault/keeper/grpc_query_vault.go b/protocol/x/vault/keeper/grpc_query_vault.go index aa8b22b3a2..48f7873b68 100644 --- a/protocol/x/vault/keeper/grpc_query_vault.go +++ b/protocol/x/vault/keeper/grpc_query_vault.go @@ -3,9 +3,7 @@ package keeper import ( "context" "fmt" - "sort" - storetypes "cosmossdk.io/store/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -34,24 +32,6 @@ func (k Keeper) Vault( return nil, status.Error(codes.NotFound, "vault not found") } - // Get all owner shares. - allOwnerShares := []types.OwnerShares{} - ownerSharesStore := k.getVaultOwnerSharesStore(ctx, vaultId) - ownerSharesIterator := storetypes.KVStorePrefixIterator(ownerSharesStore, []byte{}) - defer ownerSharesIterator.Close() - for ; ownerSharesIterator.Valid(); ownerSharesIterator.Next() { - var shares types.NumShares - k.cdc.MustUnmarshal(ownerSharesIterator.Value(), &shares) - - allOwnerShares = append(allOwnerShares, types.OwnerShares{ - Owner: string(ownerSharesIterator.Key()), - Shares: shares.NumShares.BigInt().Uint64(), - }) - } - sort.Slice(allOwnerShares, func(i, j int) bool { - return allOwnerShares[i].Shares > allOwnerShares[j].Shares - }) - // Get vault equity. equity, err := k.GetVaultEquity(ctx, vaultId) if err != nil { @@ -67,11 +47,10 @@ func (k Keeper) Vault( inventory := k.GetVaultInventoryInPerpetual(ctx, vaultId, perpId) return &types.QueryVaultResponse{ - VaultId: vaultId, - SubaccountId: *vaultId.ToSubaccountId(), - Equity: equity.Uint64(), - Inventory: inventory.Uint64(), - TotalShares: totalShares.NumShares.BigInt().Uint64(), - AllOwnerShares: allOwnerShares, + VaultId: vaultId, + SubaccountId: *vaultId.ToSubaccountId(), + Equity: equity.Uint64(), + Inventory: inventory.Uint64(), + TotalShares: totalShares.NumShares.BigInt().Uint64(), }, nil } diff --git a/protocol/x/vault/keeper/grpc_query_vault_test.go b/protocol/x/vault/keeper/grpc_query_vault_test.go index 66695aef72..07d02a166a 100644 --- a/protocol/x/vault/keeper/grpc_query_vault_test.go +++ b/protocol/x/vault/keeper/grpc_query_vault_test.go @@ -27,8 +27,6 @@ func TestVault(t *testing.T) { inventory *big.Int // Total shares. totalShares *big.Int - // All owner shares (in descending number of shares). - allOwnerShares []vaulttypes.OwnerShares // Query request. req *vaulttypes.QueryVaultRequest @@ -41,21 +39,11 @@ func TestVault(t *testing.T) { Type: vaulttypes.VaultType_VAULT_TYPE_CLOB, Number: 0, }, - vaultId: constants.Vault_Clob_0, - asset: big.NewInt(100), - perpId: 0, - inventory: big.NewInt(200), - totalShares: big.NewInt(300), - allOwnerShares: []vaulttypes.OwnerShares{ - { - Owner: constants.Alice_Num0.Owner, - Shares: 244, - }, - { - Owner: constants.Bob_Num0.Owner, - Shares: 56, - }, - }, + vaultId: constants.Vault_Clob_0, + asset: big.NewInt(100), + perpId: 0, + inventory: big.NewInt(200), + totalShares: big.NewInt(300), expectedEquity: 500, }, "Error: query non-existent vault": { @@ -68,16 +56,6 @@ func TestVault(t *testing.T) { perpId: 0, inventory: big.NewInt(200), totalShares: big.NewInt(300), - allOwnerShares: []vaulttypes.OwnerShares{ - { - Owner: constants.Alice_Num0.Owner, - Shares: 244, - }, - { - Owner: constants.Bob_Num0.Owner, - Shares: 56, - }, - }, expectedErr: "vault not found", }, "Error: nil request": { @@ -122,18 +100,9 @@ func TestVault(t *testing.T) { ctx := tApp.InitChain() k := tApp.App.VaultKeeper - // Set total shares and owner shares. + // Set total shares. err := k.SetTotalShares(ctx, tc.vaultId, vaulttypes.BigIntToNumShares(tc.totalShares)) require.NoError(t, err) - for _, ownerShares := range tc.allOwnerShares { - err := k.SetOwnerShares( - ctx, - tc.vaultId, - ownerShares.Owner, - vaulttypes.BigIntToNumShares(big.NewInt(int64(ownerShares.Shares))), - ) - require.NoError(t, err) - } // Check Vault query response is as expected. response, err := k.Vault(ctx, tc.req) @@ -142,12 +111,11 @@ func TestVault(t *testing.T) { } else { require.NoError(t, err) expectedResponse := vaulttypes.QueryVaultResponse{ - VaultId: tc.vaultId, - SubaccountId: *tc.vaultId.ToSubaccountId(), - Equity: tc.expectedEquity, - Inventory: tc.inventory.Uint64(), - TotalShares: tc.totalShares.Uint64(), - AllOwnerShares: tc.allOwnerShares, + VaultId: tc.vaultId, + SubaccountId: *tc.vaultId.ToSubaccountId(), + Equity: tc.expectedEquity, + Inventory: tc.inventory.Uint64(), + TotalShares: tc.totalShares.Uint64(), } require.Equal(t, expectedResponse, *response) } diff --git a/protocol/x/vault/types/query.pb.go b/protocol/x/vault/types/query.pb.go index 6c5f947651..ecc6d74eb1 100644 --- a/protocol/x/vault/types/query.pb.go +++ b/protocol/x/vault/types/query.pb.go @@ -167,12 +167,11 @@ func (m *QueryVaultRequest) GetNumber() uint32 { // QueryVaultResponse is a response type for the Vault RPC method. type QueryVaultResponse struct { - VaultId VaultId `protobuf:"bytes,1,opt,name=vault_id,json=vaultId,proto3" json:"vault_id"` - SubaccountId types.SubaccountId `protobuf:"bytes,2,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id"` - Equity uint64 `protobuf:"varint,3,opt,name=equity,proto3" json:"equity,omitempty"` - Inventory uint64 `protobuf:"varint,4,opt,name=inventory,proto3" json:"inventory,omitempty"` - TotalShares uint64 `protobuf:"varint,5,opt,name=total_shares,json=totalShares,proto3" json:"total_shares,omitempty"` - AllOwnerShares []OwnerShares `protobuf:"bytes,6,rep,name=all_owner_shares,json=allOwnerShares,proto3" json:"all_owner_shares"` + VaultId VaultId `protobuf:"bytes,1,opt,name=vault_id,json=vaultId,proto3" json:"vault_id"` + SubaccountId types.SubaccountId `protobuf:"bytes,2,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id"` + Equity uint64 `protobuf:"varint,3,opt,name=equity,proto3" json:"equity,omitempty"` + Inventory uint64 `protobuf:"varint,4,opt,name=inventory,proto3" json:"inventory,omitempty"` + TotalShares uint64 `protobuf:"varint,5,opt,name=total_shares,json=totalShares,proto3" json:"total_shares,omitempty"` } func (m *QueryVaultResponse) Reset() { *m = QueryVaultResponse{} } @@ -243,113 +242,49 @@ func (m *QueryVaultResponse) GetTotalShares() uint64 { return 0 } -func (m *QueryVaultResponse) GetAllOwnerShares() []OwnerShares { - if m != nil { - return m.AllOwnerShares - } - return nil -} - -// OwnerShares is a message type for an owner and their shares. -type OwnerShares struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Shares uint64 `protobuf:"varint,2,opt,name=shares,proto3" json:"shares,omitempty"` -} - -func (m *OwnerShares) Reset() { *m = OwnerShares{} } -func (m *OwnerShares) String() string { return proto.CompactTextString(m) } -func (*OwnerShares) ProtoMessage() {} -func (*OwnerShares) Descriptor() ([]byte, []int) { - return fileDescriptor_478fb8dc0ff21ea6, []int{4} -} -func (m *OwnerShares) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *OwnerShares) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_OwnerShares.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 *OwnerShares) XXX_Merge(src proto.Message) { - xxx_messageInfo_OwnerShares.Merge(m, src) -} -func (m *OwnerShares) XXX_Size() int { - return m.Size() -} -func (m *OwnerShares) XXX_DiscardUnknown() { - xxx_messageInfo_OwnerShares.DiscardUnknown(m) -} - -var xxx_messageInfo_OwnerShares proto.InternalMessageInfo - -func (m *OwnerShares) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *OwnerShares) GetShares() uint64 { - if m != nil { - return m.Shares - } - return 0 -} - func init() { proto.RegisterType((*QueryParamsRequest)(nil), "dydxprotocol.vault.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "dydxprotocol.vault.QueryParamsResponse") proto.RegisterType((*QueryVaultRequest)(nil), "dydxprotocol.vault.QueryVaultRequest") proto.RegisterType((*QueryVaultResponse)(nil), "dydxprotocol.vault.QueryVaultResponse") - proto.RegisterType((*OwnerShares)(nil), "dydxprotocol.vault.OwnerShares") } func init() { proto.RegisterFile("dydxprotocol/vault/query.proto", fileDescriptor_478fb8dc0ff21ea6) } var fileDescriptor_478fb8dc0ff21ea6 = []byte{ - // 559 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xce, 0x6e, 0x93, 0x68, 0x27, 0x6d, 0xd1, 0x31, 0x48, 0x88, 0xed, 0x26, 0x2e, 0x34, 0xc6, - 0x43, 0x77, 0x31, 0x2a, 0x0a, 0x7a, 0xea, 0xcd, 0x53, 0xcc, 0x56, 0x3c, 0x78, 0x30, 0x4c, 0x92, - 0x21, 0x59, 0xd8, 0xcc, 0x6c, 0x76, 0x66, 0x63, 0x97, 0x52, 0x10, 0xef, 0x82, 0xe0, 0xcd, 0x5f, - 0xd4, 0x9b, 0x05, 0x2f, 0x9e, 0x44, 0x12, 0x7f, 0x88, 0xec, 0x9b, 0x69, 0xba, 0x69, 0x13, 0x7a, - 0x59, 0xe6, 0x7d, 0xef, 0x9b, 0xef, 0x7b, 0x6f, 0xde, 0x5b, 0x64, 0x0d, 0x92, 0xc1, 0x71, 0x18, - 0x71, 0xc9, 0xfb, 0x3c, 0x70, 0xa7, 0x24, 0x0e, 0xa4, 0x3b, 0x89, 0x69, 0x94, 0x38, 0x00, 0x62, - 0x9c, 0xcd, 0x3b, 0x90, 0xaf, 0x96, 0x87, 0x7c, 0xc8, 0x01, 0x73, 0xd3, 0x93, 0x62, 0x56, 0x77, - 0x87, 0x9c, 0x0f, 0x03, 0xea, 0x92, 0xd0, 0x77, 0x09, 0x63, 0x5c, 0x12, 0xe9, 0x73, 0x26, 0x74, - 0xf6, 0xf1, 0x92, 0x8f, 0x88, 0x7b, 0xa4, 0xdf, 0xe7, 0x31, 0x93, 0x22, 0x73, 0xd6, 0xd4, 0xda, - 0x8a, 0x92, 0x42, 0x12, 0x91, 0xf1, 0x85, 0xd6, 0xaa, 0x9a, 0xe1, 0xab, 0x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 0xaa, 0x2d, 0x7a, 0x45, 0xc0, - 0x9f, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x6a, 0xd1, 0x53, 0xbe, 0xa2, 0x04, 0x00, 0x00, + // 502 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xcf, 0x6b, 0x13, 0x41, + 0x18, 0xcd, 0xc4, 0x24, 0xea, 0xb4, 0x15, 0x1c, 0x8b, 0x84, 0xb5, 0xdd, 0xc4, 0x85, 0xc6, 0x78, + 0xe8, 0x0e, 0x46, 0x45, 0x0f, 0x9e, 0x7a, 0xf3, 0xa4, 0xd9, 0x8a, 0x07, 0x0f, 0x96, 0xc9, 0x66, + 0xd8, 0x2c, 0x24, 0x33, 0x9b, 0x9d, 0xd9, 0xd0, 0xa5, 0x14, 0xc4, 0xbb, 0x20, 0x78, 0xf3, 0x2f, + 0xea, 0xb1, 0xe0, 0xc5, 0x93, 0x48, 0xe2, 0xdf, 0x21, 0xb2, 0xdf, 0x8e, 0xe9, 0x6e, 0x9b, 0xd0, + 0xcb, 0x30, 0xf3, 0xbe, 0x37, 0xef, 0x7d, 0xbf, 0xb0, 0x3d, 0x4c, 0x87, 0xc7, 0x51, 0x2c, 0xb5, + 0xf4, 0xe5, 0x98, 0xce, 0x58, 0x32, 0xd6, 0x74, 0x9a, 0xf0, 0x38, 0x75, 0x01, 0x24, 0xa4, 0x18, + 0x77, 0x21, 0x6e, 0x6d, 0x07, 0x32, 0x90, 0x80, 0xd1, 0xec, 0x96, 0x33, 0xad, 0x9d, 0x40, 0xca, + 0x60, 0xcc, 0x29, 0x8b, 0x42, 0xca, 0x84, 0x90, 0x9a, 0xe9, 0x50, 0x0a, 0x65, 0xa2, 0x8f, 0x4b, + 0x3e, 0x2a, 0x19, 0x30, 0xdf, 0x97, 0x89, 0xd0, 0xaa, 0x70, 0x37, 0xd4, 0xd6, 0x8a, 0x94, 0x22, + 0x16, 0xb3, 0xc9, 0x7f, 0xad, 0x55, 0x39, 0xc3, 0x99, 0xc7, 0x9d, 0x6d, 0x4c, 0xfa, 0x59, 0x09, + 0x6f, 0xe1, 0x93, 0xc7, 0xa7, 0x09, 0x57, 0xda, 0x79, 0x83, 0xef, 0x95, 0x50, 0x15, 0x49, 0xa1, + 0x38, 0x79, 0x89, 0x1b, 0xb9, 0x78, 0x13, 0xb5, 0x51, 0x77, 0xa3, 0x67, 0xb9, 0x57, 0x2b, 0x76, + 0xf3, 0x3f, 0x07, 0xb5, 0xb3, 0x5f, 0xad, 0x8a, 0x67, 0xf8, 0xce, 0x47, 0x7c, 0x17, 0x04, 0xdf, + 0x67, 0x14, 0xe3, 0x42, 0x9e, 0xe0, 0x9a, 0x4e, 0x23, 0x0e, 0x62, 0x77, 0x7a, 0xbb, 0xab, 0xc4, + 0x80, 0xff, 0x2e, 0x8d, 0xb8, 0x07, 0x54, 0x72, 0x1f, 0x37, 0x44, 0x32, 0x19, 0xf0, 0xb8, 0x59, + 0x6d, 0xa3, 0xee, 0x96, 0x67, 0x5e, 0xce, 0x5f, 0x64, 0xea, 0x30, 0x06, 0x26, 0xe1, 0x57, 0xf8, + 0x16, 0xe8, 0x1c, 0x85, 0x43, 0x93, 0xf2, 0x83, 0xb5, 0x2e, 0xaf, 0x87, 0x26, 0xe7, 0x9b, 0xb3, + 0xfc, 0x49, 0xfa, 0x78, 0xeb, 0xa2, 0xe1, 0x99, 0x44, 0x15, 0x24, 0x3a, 0x65, 0x89, 0xc2, 0x7c, + 0xdc, 0xc3, 0xe5, 0x7d, 0xa9, 0xb6, 0xa9, 0x0a, 0x58, 0x96, 0x3f, 0x9f, 0x26, 0xa1, 0x4e, 0x9b, + 0x37, 0xda, 0xa8, 0x5b, 0xf3, 0xcc, 0x8b, 0xec, 0xe0, 0xdb, 0xa1, 0x98, 0x71, 0xa1, 0x65, 0x9c, + 0x36, 0x6b, 0x10, 0xba, 0x00, 0xc8, 0x43, 0xbc, 0xa9, 0xa5, 0x66, 0xe3, 0x23, 0x35, 0x62, 0x31, + 0x57, 0xcd, 0x3a, 0x10, 0x36, 0x00, 0x3b, 0x04, 0xa8, 0xf7, 0xbd, 0x8a, 0xeb, 0xd0, 0x00, 0xf2, + 0x09, 0xe1, 0x46, 0x3e, 0x03, 0xd2, 0x59, 0x55, 0xec, 0xd5, 0x71, 0x5b, 0x8f, 0xae, 0xe5, 0xe5, + 0xfd, 0x74, 0xf6, 0x3e, 0xff, 0xf8, 0xf3, 0xad, 0xda, 0x22, 0xbb, 0xb4, 0xbc, 0x56, 0xcf, 0x4a, + 0xab, 0x47, 0xbe, 0x20, 0x5c, 0x87, 0x9e, 0x92, 0xbd, 0xb5, 0xca, 0xc5, 0x4d, 0xb0, 0x3a, 0xd7, + 0xd1, 0x8c, 0xff, 0x73, 0xf0, 0xa7, 0x64, 0x7f, 0x8d, 0x3f, 0x9c, 0x8a, 0x9e, 0x64, 0xbb, 0x72, + 0x4a, 0x4f, 0xf2, 0xe5, 0x38, 0x3d, 0xe8, 0x9f, 0xcd, 0x6d, 0x74, 0x3e, 0xb7, 0xd1, 0xef, 0xb9, + 0x8d, 0xbe, 0x2e, 0xec, 0xca, 0xf9, 0xc2, 0xae, 0xfc, 0x5c, 0xd8, 0x95, 0x0f, 0x2f, 0x82, 0x50, + 0x8f, 0x92, 0x81, 0xeb, 0xcb, 0xc9, 0x65, 0xc9, 0x7d, 0x7f, 0xc4, 0x42, 0x41, 0x97, 0xc8, 0xb1, + 0xf1, 0xc8, 0xb4, 0xd5, 0xa0, 0x01, 0xf8, 0xd3, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd2, 0xca, + 0xa6, 0x6c, 0x14, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -581,20 +516,6 @@ func (m *QueryVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.AllOwnerShares) > 0 { - for iNdEx := len(m.AllOwnerShares) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AllOwnerShares[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } if m.TotalShares != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.TotalShares)) i-- @@ -633,41 +554,6 @@ func (m *QueryVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *OwnerShares) 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 *OwnerShares) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *OwnerShares) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Shares != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Shares)) - i-- - dAtA[i] = 0x10 - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -733,28 +619,6 @@ func (m *QueryVaultResponse) Size() (n int) { if m.TotalShares != 0 { n += 1 + sovQuery(uint64(m.TotalShares)) } - if len(m.AllOwnerShares) > 0 { - for _, e := range m.AllOwnerShares { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *OwnerShares) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Shares != 0 { - n += 1 + sovQuery(uint64(m.Shares)) - } return n } @@ -1137,141 +1001,6 @@ func (m *QueryVaultResponse) Unmarshal(dAtA []byte) error { break } } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllOwnerShares", 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.AllOwnerShares = append(m.AllOwnerShares, OwnerShares{}) - if err := m.AllOwnerShares[len(m.AllOwnerShares)-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 *OwnerShares) 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: OwnerShares: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: OwnerShares: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Shares", wireType) - } - m.Shares = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Shares |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:])