2018-06-28 17:54:47 -07:00
|
|
|
package crypto
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2019-02-05 08:22:56 -08:00
|
|
|
"github.com/cosmos/cosmos-sdk/crypto/keys/hd"
|
2018-06-28 17:54:47 -07:00
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2019-02-05 10:21:04 -08:00
|
|
|
// This tests assume a ledger is not plugged in
|
|
|
|
func TestLedgerErrorHandling(t *testing.T) {
|
2018-06-28 17:54:47 -07:00
|
|
|
// first, try to generate a key, must return an error
|
|
|
|
// (no panic)
|
2019-02-05 10:21:04 -08:00
|
|
|
path := *hd.NewParams(44, 555, 0, false, 0)
|
|
|
|
_, err := NewPrivKeyLedgerSecp256k1(path)
|
2018-06-28 17:54:47 -07:00
|
|
|
require.Error(t, err)
|
|
|
|
}
|