diff --git a/v2/service/convert.go b/v2/service/convert.go index bf2c3a2..2ced953 100644 --- a/v2/service/convert.go +++ b/v2/service/convert.go @@ -199,3 +199,29 @@ func RequestMetaHeaderFromGRPCMessage(m *service.RequestMetaHeader) *RequestMeta return r } + +func SignatureToGRPCMessage(s *Signature) *service.Signature { + if s == nil { + return nil + } + + m := new(service.Signature) + + m.SetKey(s.GetKey()) + m.SetSign(s.GetSign()) + + return m +} + +func SignatureFromGRPCMessage(m *service.Signature) *Signature { + if m == nil { + return nil + } + + s := new(Signature) + + s.SetKey(m.GetKey()) + s.SetSign(m.GetSign()) + + return s +} diff --git a/v2/service/service.go b/v2/service/service.go index 39557ee..1a1e0a7 100644 --- a/v2/service/service.go +++ b/v2/service/service.go @@ -1,9 +1,5 @@ package service -import ( - service "github.com/nspcc-dev/neofs-api-go/v2/service/grpc" -) - type Signature struct { key, sign []byte } @@ -315,29 +311,3 @@ func (r *RequestMetaHeader) StableSize() int { // TODO: do not use hack return RequestMetaHeaderToGRPCMessage(r).Size() } - -func SignatureToGRPCMessage(s *Signature) *service.Signature { - if s == nil { - return nil - } - - m := new(service.Signature) - - m.SetKey(s.GetKey()) - m.SetSign(s.GetSign()) - - return m -} - -func SignatureFromGRPCMessage(m *service.Signature) *Signature { - if m == nil { - return nil - } - - s := new(Signature) - - s.SetKey(m.GetKey()) - s.SetSign(m.GetSign()) - - return s -}