frostfs-node/pkg/core/container/marshal_test.go
Stanislav Bogatyrev b7b5079934 Add Inner Ring code
2020-07-24 17:07:37 +03:00

26 lines
563 B
Go

package container
import (
"testing"
"github.com/nspcc-dev/neofs-node/pkg/core/container/acl/basic"
"github.com/stretchr/testify/require"
)
func TestContainerMarshal(t *testing.T) {
srcCnr := new(Container)
srcCnr.SetBasicACL(basic.FromUint32(1))
srcCnr.SetOwnerID(OwnerID{1, 2, 3})
srcCnr.SetSalt([]byte{4, 5, 6})
srcCnr.SetPlacementRule(PlacementRule{
ReplFactor: 3,
})
data, err := srcCnr.MarshalBinary()
require.NoError(t, err)
dstCnr := new(Container)
require.NoError(t, dstCnr.UnmarshalBinary(data))
require.Equal(t, srcCnr, dstCnr)
}