From da34b10409b7340bd2ee63f0440759a2e52b89e9 Mon Sep 17 00:00:00 2001 From: Troy Kessler <43882936+troykessler@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:24:06 +0100 Subject: [PATCH] fix: add funders back to pool query (#160) (cherry picked from commit 979eaf71ab7dea55a1ee08c06b8e0a09887e7581) # Conflicts: # CHANGELOG.md --- CHANGELOG.md | 10 ++ docs/swagger.yml | 86 +++++++++++++++ proto/kyve/query/v1beta1/pools.proto | 3 + x/query/keeper/grpc_query_pool.go | 10 ++ x/query/types/pools.pb.go | 156 +++++++++++++++++++-------- 5 files changed, 220 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4bd4b63..5a531494 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,16 @@ An '!' indicates a state machine breaking change. +<<<<<<< HEAD +======= +## [Unreleased] + +### Bug Fixes + +- (`x/query`) [#159](https://github.com/KYVENetwork/chain/pull/159) Add pool params back to kyve params query. +- (`x/query`) [#160](https://github.com/KYVENetwork/chain/pull/160) Add funders back to pool query. + +>>>>>>> 979eaf7 (fix: add funders back to pool query (#160)) ## [v1.4.0](https://github.com/KYVENetwork/chain/releases/tag/v1.4.0) - 2023-11-17 ### Features diff --git a/docs/swagger.yml b/docs/swagger.yml index 1e81aabf..b825b55a 100644 --- a/docs/swagger.yml +++ b/docs/swagger.yml @@ -5066,6 +5066,49 @@ paths: type: string format: uint64 description: account_balance ... + fundings: + type: array + items: + type: object + properties: + funder_address: + type: string + title: funder_id is the id of the funder + pool_id: + type: string + format: uint64 + title: pool_id is the id of the pool this funding is for + amount: + type: string + format: uint64 + title: >- + amount is the amount of funds in ukyve the funder + has left + amount_per_bundle: + type: string + format: uint64 + title: >- + amount_per_bundle is the amount of funds in ukyve + the funder pays per bundle + total_funded: + type: string + format: uint64 + title: >- + total_funded is the total amount of funds in ukyve + the funder has funded + description: >- + Funding is the object which holds info about the current + funding + + funder_address and pool_id (m2m) are unique together + which means that + + a funder can only fund each pool once and a pool can + only be funded + + by each funder once. However, a funder can update the + amount of funds. + description: funders ... description: >- QueryPoolResponse is the response type for the Query/Pool RPC method. @@ -5563,6 +5606,49 @@ paths: type: string format: uint64 description: account_balance ... + fundings: + type: array + items: + type: object + properties: + funder_address: + type: string + title: funder_id is the id of the funder + pool_id: + type: string + format: uint64 + title: pool_id is the id of the pool this funding is for + amount: + type: string + format: uint64 + title: >- + amount is the amount of funds in ukyve the funder + has left + amount_per_bundle: + type: string + format: uint64 + title: >- + amount_per_bundle is the amount of funds in ukyve + the funder pays per bundle + total_funded: + type: string + format: uint64 + title: >- + total_funded is the total amount of funds in ukyve + the funder has funded + description: >- + Funding is the object which holds info about the + current funding + + funder_address and pool_id (m2m) are unique together + which means that + + a funder can only fund each pool once and a pool can + only be funded + + by each funder once. However, a funder can update the + amount of funds. + description: funders ... description: PoolResponse ... description: pools ... pagination: diff --git a/proto/kyve/query/v1beta1/pools.proto b/proto/kyve/query/v1beta1/pools.proto index a1ef4b0c..596df84e 100644 --- a/proto/kyve/query/v1beta1/pools.proto +++ b/proto/kyve/query/v1beta1/pools.proto @@ -6,6 +6,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "kyve/bundles/v1beta1/bundles.proto"; +import "kyve/funders/v1beta1/funders.proto"; import "kyve/pool/v1beta1/pool.proto"; option go_package = "github.com/KYVENetwork/chain/x/query/types"; @@ -69,6 +70,8 @@ message PoolResponse { string account = 8; // account_balance ... uint64 account_balance = 9; + // funders ... + repeated kyve.funders.v1beta1.Funding fundings = 10; } // ========= diff --git a/x/query/keeper/grpc_query_pool.go b/x/query/keeper/grpc_query_pool.go index 71c692c1..4dec832a 100644 --- a/x/query/keeper/grpc_query_pool.go +++ b/x/query/keeper/grpc_query_pool.go @@ -14,6 +14,8 @@ import ( poolTypes "github.com/KYVENetwork/chain/x/pool/types" // Query "github.com/KYVENetwork/chain/x/query/types" + // Funders + fundersTypes "github.com/KYVENetwork/chain/x/funders/types" ) func (k Keeper) Pools(c context.Context, req *types.QueryPoolsRequest) (*types.QueryPoolsResponse, error) { @@ -63,6 +65,13 @@ func (k Keeper) parsePoolResponse(ctx sdk.Context, pool *poolTypes.Pool) types.P poolAccount := pool.GetPoolAccount() poolBalance := k.bankKeeper.GetBalance(ctx, poolAccount, globalTypes.Denom).Amount.Uint64() + fundingsOfPool := k.fundersKeeper.GetFundingsOfPool(ctx, pool.Id) + + fundings := make([]*fundersTypes.Funding, 0) + for index := range fundingsOfPool { + fundings = append(fundings, &fundingsOfPool[index]) + } + return types.PoolResponse{ Id: pool.Id, Data: pool, @@ -73,5 +82,6 @@ func (k Keeper) parsePoolResponse(ctx sdk.Context, pool *poolTypes.Pool) types.P Status: k.GetPoolStatus(ctx, pool), Account: poolAccount.String(), AccountBalance: poolBalance, + Fundings: fundings, } } diff --git a/x/query/types/pools.pb.go b/x/query/types/pools.pb.go index 6cdad894..1a70dd1b 100644 --- a/x/query/types/pools.pb.go +++ b/x/query/types/pools.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" types1 "github.com/KYVENetwork/chain/x/bundles/types" + types2 "github.com/KYVENetwork/chain/x/funders/types" types "github.com/KYVENetwork/chain/x/pool/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" @@ -189,6 +190,8 @@ type PoolResponse struct { Account string `protobuf:"bytes,8,opt,name=account,proto3" json:"account,omitempty"` // account_balance ... AccountBalance uint64 `protobuf:"varint,9,opt,name=account_balance,json=accountBalance,proto3" json:"account_balance,omitempty"` + // funders ... + Fundings []*types2.Funding `protobuf:"bytes,10,rep,name=fundings,proto3" json:"fundings,omitempty"` } func (m *PoolResponse) Reset() { *m = PoolResponse{} } @@ -287,6 +290,13 @@ func (m *PoolResponse) GetAccountBalance() uint64 { return 0 } +func (m *PoolResponse) GetFundings() []*types2.Funding { + if m != nil { + return m.Fundings + } + return nil +} + // QueryPoolRequest is the request type for the Query/Pool RPC method. type QueryPoolRequest struct { // id defines the unique ID of the pool. @@ -390,51 +400,53 @@ func init() { func init() { proto.RegisterFile("kyve/query/v1beta1/pools.proto", fileDescriptor_b627739c2d7723dc) } var fileDescriptor_b627739c2d7723dc = []byte{ - // 693 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x4f, 0xd4, 0x4e, - 0x18, 0xde, 0xee, 0x76, 0x17, 0x18, 0x7e, 0xbf, 0x05, 0x06, 0x3f, 0xea, 0x2a, 0xa5, 0x36, 0x7c, - 0xac, 0x98, 0xb4, 0x61, 0x8d, 0x17, 0xe3, 0x69, 0x83, 0x1a, 0x63, 0xd4, 0xb5, 0x24, 0x26, 0x7a, - 0xd9, 0x4c, 0xdb, 0xa1, 0x34, 0x94, 0x4e, 0xe9, 0x4c, 0xd1, 0xd5, 0x78, 0xe1, 0x6e, 0x62, 0xe2, - 0xd1, 0x7f, 0x88, 0x23, 0x89, 0x17, 0xbd, 0x18, 0x03, 0xfe, 0x21, 0xa6, 0x33, 0xd3, 0xda, 0x15, - 0x11, 0x6f, 0xf3, 0xce, 0xfb, 0x3c, 0xef, 0xfb, 0xbc, 0x1f, 0x33, 0x40, 0xdf, 0x19, 0xed, 0x63, - 0x7b, 0x2f, 0xc3, 0xe9, 0xc8, 0xde, 0x5f, 0x77, 0x31, 0x43, 0xeb, 0x76, 0x42, 0x48, 0x44, 0xad, - 0x24, 0x25, 0x8c, 0x40, 0x98, 0xfb, 0x2d, 0xee, 0xb7, 0xa4, 0xbf, 0xb3, 0xe6, 0x11, 0xba, 0x4b, - 0xa8, 0xed, 0x22, 0x7a, 0x8a, 0x8a, 0x82, 0x30, 0x46, 0x2c, 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xd1, 0xe8, 0x4e, 0xf7, 0x0c, 0xeb, 0xf4, 0xe0, 0xac, 0x9c, 0x51, 0x10, 0xfa, 0xea, 0xe1, 0xb7, - 0xc5, 0x9a, 0x23, 0x48, 0xf0, 0xc1, 0x58, 0x6b, 0xea, 0xbc, 0x35, 0xab, 0xe7, 0xb6, 0x46, 0x44, - 0xaa, 0xf6, 0xc6, 0x7c, 0xdf, 0x00, 0xff, 0x55, 0xd3, 0xc0, 0x36, 0xa8, 0x87, 0x3e, 0x6f, 0xb6, - 0xea, 0xd4, 0x43, 0x1f, 0xde, 0x04, 0xaa, 0x8f, 0x18, 0x92, 0x39, 0x2e, 0x0b, 0x99, 0x7c, 0x74, - 0x63, 0x2a, 0x39, 0x08, 0x3e, 0x06, 0x33, 0x62, 0xec, 0x79, 0x6b, 0x12, 0x42, 0x51, 0xc4, 0x3b, - 0x3b, 0xdd, 0x5b, 0x12, 0xbc, 0x62, 0x27, 0x0a, 0x6a, 0x9f, 0xdb, 0x03, 0x89, 0x75, 0xda, 0xee, - 0x98, 0x9d, 0x0f, 0x88, 0x32, 0xb4, 0x83, 0x53, 0xaa, 0xa9, 0x46, 0x23, 0x1f, 0x90, 0x34, 0x61, - 0x0f, 0x5c, 0x64, 0x84, 0xa1, 0x68, 0x48, 0x71, 0xb4, 0x35, 0xf4, 0x71, 0x84, 0x03, 0xd1, 0x8a, - 0x26, 0x17, 0x3e, 0xcf, 0x9d, 0x9b, 0x38, 0xda, 0xda, 0x28, 0x5d, 0xf0, 0x06, 0x98, 0x15, 0x9c, - 0x0a, 0xbc, 0xc5, 0xe1, 0x33, 0xfc, 0xbe, 0x02, 0xbd, 0x0d, 0x5a, 0x94, 0x21, 0x96, 0x51, 0x6d, - 0xc2, 0x50, 0xba, 0xed, 0xde, 0xc2, 0x19, 0x65, 0x6f, 0x72, 0x90, 0x23, 0xc1, 0xb9, 0x5e, 0xe4, - 0x79, 0x24, 0x8b, 0x99, 0x36, 0x29, 0x16, 0x4a, 0x9a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 0x05, - 0xb9, 0xa8, 0x05, 0x00, 0x00, + // 723 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4d, 0x4f, 0xd4, 0x4e, + 0x18, 0xdf, 0xee, 0x1b, 0xcb, 0xf0, 0xff, 0x2f, 0x30, 0xf8, 0x52, 0x57, 0x29, 0xb5, 0xe1, 0x65, + 0xc5, 0xa4, 0x0d, 0x6b, 0x3c, 0x68, 0x3c, 0x6d, 0x10, 0x63, 0x8c, 0xba, 0x96, 0xc4, 0x44, 0x2f, + 0x9b, 0x69, 0x3b, 0x94, 0x86, 0xd2, 0x29, 0x9d, 0x29, 0xba, 0x1a, 0x2f, 0x7c, 0x02, 0x13, 0x8f, + 0x7e, 0x21, 0x8e, 0x24, 0x5e, 0xf4, 0x62, 0x0c, 0xf8, 0x41, 0x4c, 0x67, 0xa6, 0xa5, 0x2b, 0x22, + 0xde, 0xfa, 0xcc, 0xf3, 0xfb, 0x3d, 0xbf, 0xe7, 0xb5, 0x40, 0xdb, 0x19, 0xed, 0x63, 0x6b, 0x2f, + 0xc5, 0xc9, 0xc8, 0xda, 0x5f, 0x73, 0x30, 0x43, 0x6b, 0x56, 0x4c, 0x48, 0x48, 0xcd, 0x38, 0x21, + 0x8c, 0x40, 0x98, 0xf9, 0x4d, 0xee, 0x37, 0xa5, 0xbf, 0xb3, 0xea, 0x12, 0xba, 0x4b, 0xa8, 0xe5, + 0x20, 0x7a, 0x86, 0x8a, 0xfc, 0x20, 0x42, 0x2c, 0x20, 0x91, 0xe0, 0x77, 0x2e, 0xf9, 0xc4, 0x27, + 0xfc, 0xd3, 0xca, 0xbe, 0xe4, 0xeb, 0x0d, 0x9f, 0x10, 0x3f, 0xc4, 0x16, 0x8a, 0x03, 0x0b, 0x45, + 0x11, 0x61, 0x9c, 0x22, 0x35, 0x3b, 0x06, 0xcf, 0xc9, 0x49, 0x23, 0x2f, 0x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b, 0x07, + 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -690,6 +702,20 @@ func (m *PoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Fundings) > 0 { + for iNdEx := len(m.Fundings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Fundings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPools(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + } if m.AccountBalance != 0 { i = encodeVarintPools(dAtA, i, uint64(m.AccountBalance)) i-- @@ -915,6 +941,12 @@ func (m *PoolResponse) Size() (n int) { if m.AccountBalance != 0 { n += 1 + sovPools(uint64(m.AccountBalance)) } + if len(m.Fundings) > 0 { + for _, e := range m.Fundings { + l = e.Size() + n += 1 + l + sovPools(uint64(l)) + } + } return n } @@ -1516,6 +1548,40 @@ func (m *PoolResponse) Unmarshal(dAtA []byte) error { break } } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fundings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPools + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPools + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPools + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fundings = append(m.Fundings, &types2.Funding{}) + if err := m.Fundings[len(m.Fundings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPools(dAtA[iNdEx:])