forked from TrueCloudLab/frostfs-node
[#279] container: Use new methods to work with container format
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
9680dfbdea
commit
e53bf574b5
6 changed files with 18 additions and 20 deletions
|
@ -31,16 +31,14 @@ func TestCheckFormat(t *testing.T) {
|
|||
|
||||
c.SetOwnerID(owner.NewIDFromNeo3Wallet(wallet))
|
||||
|
||||
c.SetNonce(nil)
|
||||
// set incorrect nonce
|
||||
cV2 := c.ToV2()
|
||||
cV2.SetNonce([]byte{1, 2, 3})
|
||||
c = container.NewContainerFromV2(cV2)
|
||||
|
||||
require.Error(t, CheckFormat(c))
|
||||
|
||||
uid, err := uuid.NewRandom()
|
||||
require.NoError(t, err)
|
||||
|
||||
nonce, _ := uid.MarshalBinary()
|
||||
|
||||
c.SetNonce(nonce)
|
||||
c.SetNonceUUID(uuid.New())
|
||||
|
||||
require.NoError(t, CheckFormat(c))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue