From 53e6fbbbf92579ec3f6b71b15539a96c6fc3b131 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 25 Dec 2019 17:06:38 +0300 Subject: [PATCH] base58: add a test for a025b9c42deaca048620636e73b1a2da29274fb3 As noted by @fyrchik in #579 comments. --- pkg/encoding/base58/base58_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/encoding/base58/base58_test.go b/pkg/encoding/base58/base58_test.go index e525265ae..de4d90f78 100644 --- a/pkg/encoding/base58/base58_test.go +++ b/pkg/encoding/base58/base58_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestCheckEncodeDecode(t *testing.T) { @@ -30,3 +31,11 @@ func TestCheckDecodeFailures(t *testing.T) { _, err = CheckDecode(badcsum) assert.NotNil(t, err) } + +func TestBase58LeadingZeroes(t *testing.T) { + buf := []byte{0, 0, 0, 1} + b58 := CheckEncode(buf) + dec, err := CheckDecode(b58) + require.NoError(t, err) + require.Equal(t, buf, dec) +}