forked from TrueCloudLab/frostfs-sdk-go
[#64] object/test: reuse checksum and signature generators
These were missing from #53. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
39d3317ef6
commit
d6b72453fc
3 changed files with 41 additions and 6 deletions
|
@ -5,12 +5,12 @@ import (
|
|||
"math/rand"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/checksum"
|
||||
checksumtest "github.com/nspcc-dev/neofs-sdk-go/checksum/test"
|
||||
cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
ownertest "github.com/nspcc-dev/neofs-sdk-go/owner/test"
|
||||
sessiontest "github.com/nspcc-dev/neofs-sdk-go/session/test"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/signature"
|
||||
sigtest "github.com/nspcc-dev/neofs-sdk-go/signature/test"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/version"
|
||||
)
|
||||
|
||||
|
@ -88,10 +88,9 @@ func generateRaw(withParent bool) *object.RawObject {
|
|||
x.SetChildren(ID(), ID())
|
||||
x.SetAttributes(Attribute(), Attribute())
|
||||
x.SetSplitID(SplitID())
|
||||
// TODO reuse generators
|
||||
x.SetPayloadChecksum(checksum.New())
|
||||
x.SetPayloadHomomorphicHash(checksum.New())
|
||||
x.SetSignature(signature.New())
|
||||
x.SetPayloadChecksum(checksumtest.Checksum())
|
||||
x.SetPayloadHomomorphicHash(checksumtest.Checksum())
|
||||
x.SetSignature(sigtest.Signature())
|
||||
|
||||
if withParent {
|
||||
x.SetParent(generateRaw(false).Object())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue