|
|
@ -6,6 +6,7 @@ import ( |
|
|
|
|
|
|
|
"github.com/btcsuite/btcutil/base58" |
|
|
|
"github.com/stretchr/testify/assert" |
|
|
|
"github.com/stretchr/testify/require" |
|
|
|
) |
|
|
|
|
|
|
|
type keyData struct { |
|
|
@ -39,3 +40,9 @@ func TestPubKeySecp256k1Address(t *testing.T) { |
|
|
|
assert.Equal(t, addr, addrB, "Expected addresses to match") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func TestPubKeyInvalidDataProperReturnsEmpty(t *testing.T) { |
|
|
|
pk, err := PubKeyFromBytes([]byte("foo")) |
|
|
|
require.NotNil(t, err, "expecting a non-nil error") |
|
|
|
require.True(t, pk.Empty(), "expecting an empty public key on error") |
|
|
|
} |