From 5318abcf389d14325f1dad7e5c3ff48bbe32b75c Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 21 Oct 2020 18:49:07 +0300 Subject: [PATCH] [#88] object/search: Use String() methods to calculate ID values Replace hex encoding of IDs with String() call (base58) in search query processing. Signed-off-by: Leonard Lyubich --- pkg/services/object/search/query/v1/v1.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/services/object/search/query/v1/v1.go b/pkg/services/object/search/query/v1/v1.go index eecc21879..ba1fd1329 100644 --- a/pkg/services/object/search/query/v1/v1.go +++ b/pkg/services/object/search/query/v1/v1.go @@ -1,8 +1,6 @@ package query import ( - "encoding/hex" - "github.com/nspcc-dev/neofs-api-go/pkg/container" objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object" "github.com/nspcc-dev/neofs-api-go/pkg/owner" @@ -21,15 +19,15 @@ func New(filters objectSDK.SearchFilters) query.Query { } func idValue(id *objectSDK.ID) string { - return hex.EncodeToString(id.ToV2().GetValue()) + return id.String() } func cidValue(id *container.ID) string { - return hex.EncodeToString(id.ToV2().GetValue()) + return id.String() } func ownerIDValue(id *owner.ID) string { - return hex.EncodeToString(id.ToV2().GetValue()) + return id.String() } func (q *Query) Match(obj *object.Object, handler func(*objectSDK.ID)) {