[#38] localstore: Finalize object to meta converter

Use CutPayload method of RawObject in order to make object meta structure
from source object.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-22 17:56:53 +03:00 committed by Alex Vanin
parent 2f57855775
commit 21fc85540a

View file

@ -46,13 +46,7 @@ func metaFromObject(o *object.Object) *ObjectMeta {
meta := new(ObjectMeta) meta := new(ObjectMeta)
meta.savedAtEpoch = 10 meta.savedAtEpoch = 10
raw := object.NewRaw() meta.head = object.NewRawFromObject(o).CutPayload().Object()
raw.SetID(o.GetID())
raw.SetContainerID(o.GetContainerID())
raw.SetOwnerID(o.GetOwnerID())
// TODO: set other meta fields
meta.head = raw.Object()
return meta return meta
} }