[#279] container: Use new methods to work with container format

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-12-24 13:20:20 +03:00 committed by Leonard Lyubich
parent 9680dfbdea
commit e53bf574b5
6 changed files with 18 additions and 20 deletions

View file

@ -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))
}