[#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

@ -78,16 +78,14 @@ func TestHeader_StableMarshal(t *testing.T) {
func TestObject_StableMarshal(t *testing.T) {
from := generateObject("Payload")
transport := new(grpc.Object)
t.Run("non empty", func(t *testing.T) {
wire, err := from.StableMarshal(nil)
require.NoError(t, err)
err = goproto.Unmarshal(wire, transport)
require.NoError(t, err)
to := new(object.Object)
require.NoError(t, to.Unmarshal(wire))
to := object.ObjectFromGRPCMessage(transport)
require.Equal(t, from, to)
})
}