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

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-13 15:38:55 +03:00 committed by Alex Vanin
parent 78374caa41
commit b8f86f1a60
4 changed files with 45 additions and 5 deletions

View file

@ -65,16 +65,13 @@ func TestHeader_StableMarshal(t *testing.T) {
from := generateHeader(500)
from.SetSplit(split)
transport := new(grpc.Header)
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.Header)
require.NoError(t, to.Unmarshal(wire))
to := object.HeaderFromGRPCMessage(transport)
require.Equal(t, from, to)
})
}