[#168] acl: Implement binary/JSON encoders/decoders on Table

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-13 14:55:45 +03:00 committed by Alex Vanin
parent ae68790bbd
commit 233756ca8f
6 changed files with 117 additions and 96 deletions

View file

@ -170,7 +170,6 @@ func TestRecord_StableMarshal(t *testing.T) {
func TestTable_StableMarshal(t *testing.T) {
tableFrom := new(acl.Table)
transport := new(grpc.EACLTable)
t.Run("non empty", func(t *testing.T) {
cid := new(refs.ContainerID)
@ -190,10 +189,9 @@ func TestTable_StableMarshal(t *testing.T) {
wire, err := tableFrom.StableMarshal(nil)
require.NoError(t, err)
err = goproto.Unmarshal(wire, transport)
require.NoError(t, err)
tableTo := new(acl.Table)
require.NoError(t, tableTo.Unmarshal(wire))
tableTo := acl.TableFromGRPCMessage(transport)
require.Equal(t, tableFrom, tableTo)
})
}