[#168] refs: Implement binary/JSON encoders/decoders on Address

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-13 15:58:53 +03:00 committed by Alex Vanin
parent 9325e22871
commit 4ce751f13c
7 changed files with 114 additions and 33 deletions

View file

@ -20,6 +20,13 @@ func randID(t *testing.T) *ID {
return id
}
func randCID(t *testing.T) *container.ID {
id := container.NewID()
id.SetSHA256(randSHA256Checksum(t))
return id
}
func randSHA256Checksum(t *testing.T) (cs [sha256.Size]byte) {
_, err := rand.Read(cs[:])
require.NoError(t, err)