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) +}