frostfs-api-go/v2/audit/test/generate.go
Leonard Lyubich 1031f3122e [#263] v2: Support new rpc library
Implement `message.Message` interface on all structures and use new methods
for conversion instead of functions. make `Unmarshal` and JSON methods to
use encoding functions from `message` library. Remove all per-service
clients and implement `rpc` library of the functions which execute NeoFS API
RPC through new RPC client. Remove no longer used gRPC per-service clients.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-03-17 14:03:49 +03:00

30 lines
707 B
Go

package audittest
import (
"github.com/nspcc-dev/neofs-api-go/v2/audit"
refstest "github.com/nspcc-dev/neofs-api-go/v2/refs/test"
)
func GenerateDataAuditResult(empty bool) *audit.DataAuditResult {
m := new(audit.DataAuditResult)
if !empty {
m.SetPublicKey([]byte{1, 2, 3})
m.SetAuditEpoch(13)
m.SetHit(100)
m.SetMiss(200)
m.SetFail(300)
m.SetComplete(true)
m.SetPassNodes([][]byte{{1}, {2}})
m.SetFailNodes([][]byte{{3}, {4}})
m.SetRequests(666)
m.SetRetries(777)
}
m.SetVersion(refstest.GenerateVersion(empty))
m.SetContainerID(refstest.GenerateContainerID(empty))
m.SetPassSG(refstest.GenerateObjectIDs(empty))
m.SetFailSG(refstest.GenerateObjectIDs(empty))
return m
}