frostfs-api-go/pkg/storagegroup/test/generate.go
Leonard Lyubich 318755e9de [#293] pkg/storagegroup: Implement and use generator of StorageGroup
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-08 18:59:15 +03:00

20 lines
561 B
Go

package storagegrouptest
import (
"github.com/nspcc-dev/neofs-api-go/pkg/object"
objecttest "github.com/nspcc-dev/neofs-api-go/pkg/object/test"
"github.com/nspcc-dev/neofs-api-go/pkg/storagegroup"
refstest "github.com/nspcc-dev/neofs-api-go/pkg/test"
)
// Generate returns random storagegroup.StorageGroup.
func Generate() *storagegroup.StorageGroup {
x := storagegroup.New()
x.SetExpirationEpoch(66)
x.SetValidationDataSize(322)
x.SetValidationDataHash(refstest.Checksum())
x.SetMembers([]*object.ID{objecttest.ID(), objecttest.ID()})
return x
}