diff --git a/api/layer/neofs_mock.go b/api/layer/neofs_mock.go index 2cead060b..6a02437a3 100644 --- a/api/layer/neofs_mock.go +++ b/api/layer/neofs_mock.go @@ -71,6 +71,10 @@ func (t *TestNeoFS) CreateContainer(_ context.Context, prm PrmContainerCreate) ( container.SetCreationTime(&cnr, time.Now()) if prm.Name != "" { + var d container.Domain + d.SetName(prm.Name) + + container.WriteDomain(&cnr, d) container.SetName(&cnr, prm.Name) } @@ -78,13 +82,6 @@ func (t *TestNeoFS) CreateContainer(_ context.Context, prm PrmContainerCreate) ( cnr.SetAttribute(prm.AdditionalAttributes[i][0], prm.AdditionalAttributes[i][1]) } - if prm.Name != "" { - var d container.Domain - d.SetName(prm.Name) - - container.WriteDomain(&cnr, d) - } - b := make([]byte, 32) if _, err := io.ReadFull(rand.Reader, b); err != nil { return nil, err diff --git a/internal/neofs/neofs.go b/internal/neofs/neofs.go index 26ed527cc..dffa0ebdf 100644 --- a/internal/neofs/neofs.go +++ b/internal/neofs/neofs.go @@ -120,6 +120,10 @@ func (x *NeoFS) CreateContainer(ctx context.Context, prm layer.PrmContainerCreat container.SetCreationTime(&cnr, time.Now()) if prm.Name != "" { + var d container.Domain + d.SetName(prm.Name) + + container.WriteDomain(&cnr, d) container.SetName(&cnr, prm.Name) } @@ -136,13 +140,6 @@ func (x *NeoFS) CreateContainer(ctx context.Context, prm layer.PrmContainerCreat container.DisableHomomorphicHashing(&cnr) } - if prm.Name != "" { - var d container.Domain - d.SetName(prm.Name) - - container.WriteDomain(&cnr, d) - } - var prmPut pool.PrmContainerPut prmPut.SetContainer(cnr) prmPut.SetWaitParams(x.await)