diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index e0d11ec..88419cc 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -46437,7 +46437,7 @@ paths: } tags: - Query - /planetmint/asset/address/{address}/{lookupPeriodInMin}: + /planetmint/asset/address/{address}/{numElements}: get: summary: Queries a list of GetCIDsByAddress items. operationId: PlanetmintgoAssetGetCIDsByAddress @@ -46502,7 +46502,7 @@ paths: in: path required: true type: string - - name: lookupPeriodInMin + - name: numElements in: path required: true type: string diff --git a/proto/planetmintgo/asset/query.proto b/proto/planetmintgo/asset/query.proto index cfa3ab4..655c6e2 100644 --- a/proto/planetmintgo/asset/query.proto +++ b/proto/planetmintgo/asset/query.proto @@ -20,7 +20,7 @@ service Query { // Queries a list of GetCIDsByAddress items. rpc GetCIDsByAddress (QueryGetCIDsByAddressRequest) returns (QueryGetCIDsByAddressResponse) { - option (google.api.http).get = "/planetmint/asset/address/{address}/{lookupPeriodInMin}"; + option (google.api.http).get = "/planetmint/asset/address/{address}/{numElements}"; } @@ -42,7 +42,7 @@ message QueryParamsResponse { message QueryGetCIDsByAddressRequest { string address = 1; - uint64 lookupPeriodInMin = 2; + uint64 numElements = 2; cosmos.base.query.v1beta1.PageRequest pagination = 3; } diff --git a/x/asset/client/cli/query_address.go b/x/asset/client/cli/query_address.go index e9c886f..aeb889d 100644 --- a/x/asset/client/cli/query_address.go +++ b/x/asset/client/cli/query_address.go @@ -19,7 +19,7 @@ func CmdGetByAddress() *cobra.Command { Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) (err error) { reqAddress := args[0] - reqLookupPeriodInMin, err := cast.ToUint64E(args[1]) + reqNumElements, err := cast.ToUint64E(args[1]) if err != nil { return err } @@ -33,8 +33,8 @@ func CmdGetByAddress() *cobra.Command { params := &types.QueryGetCIDsByAddressRequest{ - Address: reqAddress, - LookupPeriodInMin: reqLookupPeriodInMin, + Address: reqAddress, + NumElements: reqNumElements, } pageReq, err := client.ReadPageRequest(cmd.Flags()) diff --git a/x/asset/keeper/asset.go b/x/asset/keeper/asset.go index 8890d66..60f5073 100644 --- a/x/asset/keeper/asset.go +++ b/x/asset/keeper/asset.go @@ -63,7 +63,7 @@ func (k Keeper) GetAssetByAddressAndID(ctx sdk.Context, address string, id uint6 func (k Keeper) GetAssetsByAddress(ctx sdk.Context, address string, start []byte, end []byte) (cids []string, found bool) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.AddressPrefix(address)) - iterator := store.Iterator(start, end) + iterator := store.ReverseIterator(start, end) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { cidBytes := iterator.Value() diff --git a/x/asset/keeper/asset_test.go b/x/asset/keeper/asset_test.go index eac7b3b..c7f3a0c 100644 --- a/x/asset/keeper/asset_test.go +++ b/x/asset/keeper/asset_test.go @@ -80,15 +80,15 @@ func TestGetAssetsByAddress(t *testing.T) { items := createNAsset(keeper, ctx, 10) cids, found := keeper.GetAssetsByAddress(ctx, items[0].Creator, nil, nil) assert.True(t, found) - assert.Equal(t, items[0].Cid, cids[0]) + assert.Equal(t, items[8].Cid, cids[0]) assert.Equal(t, items[4].Cid, cids[2]) cids, found = keeper.GetAssetsByAddress(ctx, items[1].Creator, nil, nil) assert.True(t, found) - assert.Equal(t, items[1].Cid, cids[0]) + assert.Equal(t, items[9].Cid, cids[0]) assert.Equal(t, items[5].Cid, cids[2]) cids, found = keeper.GetAssetsByAddress(ctx, items[0].Creator, util.SerializeUint64(3), nil) assert.True(t, found) assert.Equal(t, 3, len(cids)) - assert.Equal(t, items[4].Cid, cids[0]) + assert.Equal(t, items[8].Cid, cids[0]) } diff --git a/x/asset/keeper/query_address.go b/x/asset/keeper/query_address.go index ccf5777..6bb7c05 100644 --- a/x/asset/keeper/query_address.go +++ b/x/asset/keeper/query_address.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/planetmint/planetmint-go/errormsg" + "github.com/planetmint/planetmint-go/util" "github.com/planetmint/planetmint-go/x/asset/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -17,7 +18,7 @@ func (k Keeper) GetCIDsByAddress(goCtx context.Context, req *types.QueryGetCIDsB ctx := sdk.UnwrapSDKContext(goCtx) - cids, found := k.GetCidsByAddress(ctx, req.GetAddress()) + cids, found := k.GetAssetsByAddress(ctx, req.GetAddress(), nil, util.SerializeUint64(req.GetNumElements())) if !found { return nil, status.Error(codes.NotFound, "no CIDs found") } diff --git a/x/asset/keeper/query_address_test.go b/x/asset/keeper/query_address_test.go index 8529dc1..dea2dbd 100644 --- a/x/asset/keeper/query_address_test.go +++ b/x/asset/keeper/query_address_test.go @@ -4,6 +4,7 @@ import ( "testing" keepertest "github.com/planetmint/planetmint-go/testutil/keeper" + "github.com/planetmint/planetmint-go/util" "github.com/planetmint/planetmint-go/x/asset/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -16,7 +17,7 @@ func TestGetNotarizedAssetByAddress(t *testing.T) { keeper, ctx := keepertest.AssetKeeper(t) wctx := sdk.WrapSDKContext(ctx) _ = createNAsset(keeper, ctx, 10) - assets, _ := keeper.GetCidsByAddress(ctx, "plmnt_address") + assets, _ := keeper.GetAssetsByAddress(ctx, "plmnt_address", nil, util.SerializeUint64(3)) for _, tc := range []struct { desc string request *types.QueryGetCIDsByAddressRequest @@ -25,7 +26,7 @@ func TestGetNotarizedAssetByAddress(t *testing.T) { }{ { desc: "cid found", - request: &types.QueryGetCIDsByAddressRequest{Address: "plmnt_address"}, + request: &types.QueryGetCIDsByAddressRequest{Address: "plmnt_address", NumElements: 3}, response: &types.QueryGetCIDsByAddressResponse{Cids: assets}, }, { diff --git a/x/asset/types/query.pb.go b/x/asset/types/query.pb.go index 94edffb..c81be35 100644 --- a/x/asset/types/query.pb.go +++ b/x/asset/types/query.pb.go @@ -114,9 +114,9 @@ func (m *QueryParamsResponse) GetParams() Params { } type QueryGetCIDsByAddressRequest struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - LookupPeriodInMin uint64 `protobuf:"varint,2,opt,name=lookupPeriodInMin,proto3" json:"lookupPeriodInMin,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + NumElements uint64 `protobuf:"varint,2,opt,name=numElements,proto3" json:"numElements,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } func (m *QueryGetCIDsByAddressRequest) Reset() { *m = QueryGetCIDsByAddressRequest{} } @@ -159,9 +159,9 @@ func (m *QueryGetCIDsByAddressRequest) GetAddress() string { return "" } -func (m *QueryGetCIDsByAddressRequest) GetLookupPeriodInMin() uint64 { +func (m *QueryGetCIDsByAddressRequest) GetNumElements() uint64 { if m != nil { - return m.LookupPeriodInMin + return m.NumElements } return 0 } @@ -333,42 +333,41 @@ func init() { func init() { proto.RegisterFile("planetmintgo/asset/query.proto", fileDescriptor_5832a953a81817c0) } var fileDescriptor_5832a953a81817c0 = []byte{ - // 547 bytes of a gzipped FileDescriptorProto + // 541 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcf, 0x6e, 0xd3, 0x30, - 0x18, 0x6f, 0xda, 0x52, 0x34, 0x73, 0xd9, 0xcc, 0x0e, 0x51, 0xd8, 0xb2, 0x2a, 0x48, 0x5b, 0x85, - 0x20, 0x26, 0xe5, 0x00, 0x9c, 0xd0, 0x0a, 0x62, 0x9a, 0xf8, 0x57, 0x72, 0xe4, 0xe6, 0x26, 0x56, - 0xb0, 0x68, 0xed, 0x2c, 0x76, 0x11, 0xa5, 0xf4, 0xc2, 0x13, 0x20, 0xf1, 0x00, 0xbc, 0x01, 0x67, - 0x1e, 0x61, 0xc7, 0x49, 0x5c, 0x38, 0x21, 0x68, 0x79, 0x10, 0x14, 0xdb, 0x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d8, 0x14, 0x13, 0x34, 0x2e, 0xdd, - 0xe1, 0x04, 0x7e, 0xb1, 0xc0, 0x56, 0x69, 0x17, 0xf0, 0xbf, 0x4e, 0x56, 0xae, 0xda, 0x69, 0x5f, - 0x04, 0x62, 0xdc, 0x5f, 0x57, 0xee, 0x77, 0xe1, 0xb5, 0xb2, 0xfb, 0x88, 0xc6, 0x68, 0x1c, 0xd1, - 0x78, 0xd2, 0x79, 0x72, 0x3a, 0x75, 0xad, 0xb3, 0xa9, 0x6b, 0xfd, 0x9a, 0xba, 0xd6, 0xa7, 0x99, - 0x5b, 0x39, 0x9b, 0xb9, 0x95, 0x1f, 0x33, 0xb7, 0xf2, 0x2a, 0x48, 0xa8, 0x7c, 0x3d, 0xec, 0xf9, - 0x11, 0x1f, 0x2c, 0x13, 0x2c, 0xca, 0x5b, 0x09, 0x47, 0xef, 0x0c, 0xa1, 0x1c, 0xa5, 0x44, 0xf4, - 0x1a, 0xea, 0x73, 0x72, 0xe7, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x76, 0xa1, 0xdb, 0x5c, 0x05, - 0x05, 0x00, 0x00, + 0x18, 0x6f, 0xda, 0x51, 0x34, 0xef, 0x32, 0xcc, 0x0e, 0x51, 0xd8, 0xb2, 0x2a, 0x48, 0x5b, 0x85, + 0x44, 0x4c, 0xba, 0x0b, 0x1c, 0x57, 0xfe, 0x4c, 0x08, 0x04, 0x23, 0x47, 0x6e, 0x6e, 0x62, 0x05, + 0x4b, 0x8d, 0x9d, 0xc5, 0x2e, 0xa2, 0x94, 0x5e, 0x78, 0x02, 0x24, 0x1e, 0x00, 0x89, 0x47, 0xe0, + 0x29, 0x76, 0x9c, 0xc4, 0x05, 0x09, 0x09, 0xa1, 0x96, 0x07, 0x41, 0xb1, 0x5d, 0x35, 0x21, 0x2d, + 0xd3, 0x6e, 0x5f, 0xec, 0xef, 0xf7, 0xc7, 0xbf, 0xef, 0x53, 0x80, 0x9b, 0x0d, 0x31, 0x23, 0x32, + 0xa5, 0x4c, 0x26, 0x1c, 0x61, 0x21, 0x88, 0x44, 0x67, 0x23, 0x92, 0x8f, 0xfd, 0x2c, 0xe7, 0x92, + 0x43, 0x58, 0xbe, 0xf7, 0xd5, 0xbd, 0xb3, 0x93, 0xf0, 0x84, 0xab, 0x6b, 0x54, 0x54, 0xba, 0xd3, + 0xd9, 0x4d, 0x38, 0x4f, 0x86, 0x04, 0xe1, 0x8c, 0x22, 0xcc, 0x18, 0x97, 0x58, 0x52, 0xce, 0x84, + 0xb9, 0xbd, 0x13, 0x71, 0x91, 0x72, 0x81, 0x06, 0x58, 0x10, 0x2d, 0x80, 0xde, 0x06, 0x03, 0x22, + 0x71, 0x80, 0x32, 0x9c, 0x50, 0xa6, 0x9a, 0x4d, 0xef, 0xfe, 0x0a, 0x4f, 0x19, 0xce, 0x71, 0x6a, + 0xc8, 0xbc, 0x1d, 0x00, 0x5f, 0x15, 0x14, 0xa7, 0xea, 0x30, 0x24, 0x67, 0x23, 0x22, 0xa4, 0xf7, + 0x12, 0xdc, 0xac, 0x9c, 0x8a, 0x8c, 0x33, 0x41, 0xe0, 0x7d, 0xd0, 0xd6, 0x60, 0xdb, 0xea, 0x58, + 0xdd, 0xad, 0x9e, 0xe3, 0xd7, 0x9f, 0xe4, 0x6b, 0x4c, 0x7f, 0xe3, 0xfc, 0xd7, 0x7e, 0x23, 0x34, + 0xfd, 0xde, 0x57, 0x0b, 0xec, 0x2a, 0xc6, 0x13, 0x22, 0x1f, 0x3e, 0x7d, 0x24, 0xfa, 0xe3, 0xe3, + 0x38, 0xce, 0x89, 0x58, 0x28, 0x42, 0x1b, 0x5c, 0xc7, 0xfa, 0x44, 0x71, 0x6f, 0x86, 0x8b, 0x4f, + 0xd8, 0x01, 0x5b, 0x6c, 0x94, 0x3e, 0x1e, 0x92, 0x94, 0x30, 0x29, 0xec, 0x66, 0xc7, 0xea, 0x6e, + 0x84, 0xe5, 0x23, 0xf8, 0x04, 0x80, 0xe5, 0xc3, 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x95, + 0xef, 0x3d, 0x78, 0xab, 0xee, 0x3b, 0xa2, 0x31, 0x9a, 0x44, 0x34, 0x9e, 0xf6, 0x9f, 0x9d, 0xcf, + 0x5c, 0xeb, 0x62, 0xe6, 0x5a, 0xbf, 0x67, 0xae, 0xf5, 0x69, 0xee, 0x36, 0x2e, 0xe6, 0x6e, 0xe3, + 0xc7, 0xdc, 0x6d, 0xbc, 0x0e, 0x12, 0x2a, 0xdf, 0x8c, 0x06, 0x7e, 0xc4, 0xd3, 0x32, 0xc1, 0xb2, + 0xbc, 0x9b, 0x70, 0xf4, 0xce, 0x10, 0xca, 0x71, 0x46, 0xc4, 0xa0, 0xad, 0x7e, 0x1e, 0x47, 0x7f, + 0x03, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x7e, 0xf6, 0x2a, 0xf3, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -617,8 +616,8 @@ func (m *QueryGetCIDsByAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, e i-- dAtA[i] = 0x1a } - if m.LookupPeriodInMin != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.LookupPeriodInMin)) + if m.NumElements != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NumElements)) i-- dAtA[i] = 0x10 } @@ -784,8 +783,8 @@ func (m *QueryGetCIDsByAddressRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - if m.LookupPeriodInMin != 0 { - n += 1 + sovQuery(uint64(m.LookupPeriodInMin)) + if m.NumElements != 0 { + n += 1 + sovQuery(uint64(m.NumElements)) } if m.Pagination != nil { l = m.Pagination.Size() @@ -1045,9 +1044,9 @@ func (m *QueryGetCIDsByAddressRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LookupPeriodInMin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NumElements", wireType) } - m.LookupPeriodInMin = 0 + m.NumElements = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1057,7 +1056,7 @@ func (m *QueryGetCIDsByAddressRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.LookupPeriodInMin |= uint64(b&0x7F) << shift + m.NumElements |= uint64(b&0x7F) << shift if b < 0x80 { break } diff --git a/x/asset/types/query.pb.gw.go b/x/asset/types/query.pb.gw.go index 3dc0c73..d8d9132 100644 --- a/x/asset/types/query.pb.gw.go +++ b/x/asset/types/query.pb.gw.go @@ -52,7 +52,7 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } var ( - filter_Query_GetCIDsByAddress_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0, "lookupPeriodInMin": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_Query_GetCIDsByAddress_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0, "numElements": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) func request_Query_GetCIDsByAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -77,15 +77,15 @@ func request_Query_GetCIDsByAddress_0(ctx context.Context, marshaler runtime.Mar return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) } - val, ok = pathParams["lookupPeriodInMin"] + val, ok = pathParams["numElements"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "lookupPeriodInMin") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "numElements") } - protoReq.LookupPeriodInMin, err = runtime.Uint64(val) + protoReq.NumElements, err = runtime.Uint64(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "lookupPeriodInMin", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "numElements", err) } if err := req.ParseForm(); err != nil { @@ -122,15 +122,15 @@ func local_request_Query_GetCIDsByAddress_0(ctx context.Context, marshaler runti return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) } - val, ok = pathParams["lookupPeriodInMin"] + val, ok = pathParams["numElements"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "lookupPeriodInMin") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "numElements") } - protoReq.LookupPeriodInMin, err = runtime.Uint64(val) + protoReq.NumElements, err = runtime.Uint64(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "lookupPeriodInMin", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "numElements", err) } if err := req.ParseForm(); err != nil { @@ -381,7 +381,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"planetmint", "asset", "params"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_GetCIDsByAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"planetmint", "asset", "address", "lookupPeriodInMin"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_GetCIDsByAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"planetmint", "asset", "address", "numElements"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_GetNotarizedAsset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 2}, []string{"planetmint", "asset", "cid"}, "", runtime.AssumeColonVerbOpt(true))) )