[#288] pkg/eacl: Convert nil eACL record to nil API v2 message

Make `Record.ToV2` method to return `nil` when called on `nil`. Write
corresponding unit test.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-27 14:35:49 +03:00 committed by Leonard Lyubich
parent b81f39368e
commit 18a3c4d54f
2 changed files with 14 additions and 0 deletions

View file

@ -119,3 +119,11 @@ func TestRecordEncoding(t *testing.T) {
require.Equal(t, r, r2)
})
}
func TestRecord_ToV2(t *testing.T) {
t.Run("nil", func(t *testing.T) {
var x *Record
require.Nil(t, x.ToV2())
})
}