[#168] object: Implement binary/JSON encoders/decoders on Object

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-13 15:51:27 +03:00 committed by Alex Vanin
parent 9cdd14841a
commit 9325e22871
7 changed files with 102 additions and 15 deletions

View file

@ -66,3 +66,15 @@ func TestHeaderWithSignatureJSON(t *testing.T) {
require.Equal(t, h, h2)
}
func TestObjectJSON(t *testing.T) {
o := generateObject("data")
data, err := o.MarshalJSON()
require.NoError(t, err)
o2 := new(object.Object)
require.NoError(t, o2.UnmarshalJSON(data))
require.Equal(t, o, o2)
}