frostfs-sdk-go/audit/test/generate.go
Evgenii Stratonikov db784a5758 [#59] audit: move package from neofs-api-go
Close #59.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-09 12:30:58 +03:00

37 lines
882 B
Go

package audittest
import (
"github.com/nspcc-dev/neofs-sdk-go/audit"
cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test"
"github.com/nspcc-dev/neofs-sdk-go/object"
objecttest "github.com/nspcc-dev/neofs-sdk-go/object/test"
"github.com/nspcc-dev/neofs-sdk-go/version"
)
// Generate returns random audit.Result.
func Generate() *audit.Result {
x := audit.NewResult()
x.SetVersion(version.Current())
x.SetContainerID(cidtest.GenerateID())
x.SetPublicKey([]byte("key"))
x.SetComplete(true)
x.SetAuditEpoch(44)
x.SetHit(55)
x.SetMiss(66)
x.SetFail(77)
x.SetRetries(88)
x.SetRequests(99)
x.SetFailNodes([][]byte{
[]byte("node1"),
[]byte("node2"),
})
x.SetPassNodes([][]byte{
[]byte("node3"),
[]byte("node4"),
})
x.SetPassSG([]*object.ID{objecttest.ID(), objecttest.ID()})
x.SetFailSG([]*object.ID{objecttest.ID(), objecttest.ID()})
return x
}