frostfs-node/pkg/core/object/object.go
Leonard Lyubich f15e6e888f [#1377] oid, cid: Upgrade SDK package
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-05-16 15:33:22 +03:00

27 lines
458 B
Go

package object
import (
"github.com/nspcc-dev/neofs-sdk-go/object"
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
)
// AddressOf returns the address of the object.
func AddressOf(obj *object.Object) *addressSDK.Address {
if obj != nil {
addr := addressSDK.NewAddress()
id, ok := obj.ID()
if ok {
addr.SetObjectID(id)
}
cnr, ok := obj.ContainerID()
if ok {
addr.SetContainerID(cnr)
}
return addr
}
return nil
}