diff --git a/pkg/object/object.go b/pkg/object/object.go index be1f5b8b..2d96002d 100644 --- a/pkg/object/object.go +++ b/pkg/object/object.go @@ -117,13 +117,6 @@ func (o *Object) CutPayload() *Object { return nil } -// ToV2 converts object to v2 Object message. -func (o *Object) ToV2() *object.Object { - obj, _ := o.rwObject.ToV2(nil) - - return obj -} - func (o *rwObject) v2Header() *object.Header { hV2 := new(object.Header) hV2.SetContainerID(o.cid.ToV2()) diff --git a/pkg/object/raw.go b/pkg/object/raw.go index c82ba5cc..ffd9f21c 100644 --- a/pkg/object/raw.go +++ b/pkg/object/raw.go @@ -38,6 +38,17 @@ func (o *RawObject) SetOwnerID(v *owner.ID) { } } +// Release returns read-only Object instance. +func (o *RawObject) Release() *Object { + if o != nil { + return &Object{ + rwObject: o.rwObject, + } + } + + return nil +} + // SetPayloadChecksumSHA256 sets payload checksum as a SHA256 checksum. func (o *RawObject) SetPayloadChecksumSHA256(v [sha256.Size]byte) { if o != nil {