Skip to content

Commit

Permalink
Remove Ledger ed25519 support, for now
Browse files Browse the repository at this point in the history
  • Loading branch information
cwgoes committed May 31, 2018
1 parent bb81e4a commit 63aac65
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 266 deletions.
4 changes: 0 additions & 4 deletions amino.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ func RegisterAmino(cdc *amino.Codec) {
cdc.RegisterInterface((*PubKey)(nil), nil)
cdc.RegisterConcrete(PubKeyEd25519{},
"tendermint/PubKeyEd25519", nil)
cdc.RegisterConcrete(PubKeyLedgerEd25519{},
"tendermint/PubKeyLedgerEd25519", nil)
cdc.RegisterConcrete(PubKeySecp256k1{},
"tendermint/PubKeySecp256k1", nil)

Expand All @@ -31,8 +29,6 @@ func RegisterAmino(cdc *amino.Codec) {
"tendermint/PrivKeySecp256k1", nil)
cdc.RegisterConcrete(PrivKeyLedgerSecp256k1{},
"tendermint/PrivKeyLedgerSecp256k1", nil)
cdc.RegisterConcrete(PrivKeyLedgerEd25519{},
"tendermint/PrivKeyLedgerEd25519", nil)

cdc.RegisterInterface((*Signature)(nil), nil)
cdc.RegisterConcrete(SignatureEd25519{},
Expand Down
156 changes: 0 additions & 156 deletions ledger_ed25519.go

This file was deleted.

68 changes: 0 additions & 68 deletions ledger_pub_key.go

This file was deleted.

38 changes: 0 additions & 38 deletions ledger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,44 +46,6 @@ func TestRealLedgerSecp256k1(t *testing.T) {
assert.Equal(t, pub, bpub)
}

func TestRealLedgerEd25519(t *testing.T) {

if os.Getenv("WITH_LEDGER") == "" {
t.Skip("Set WITH_LEDGER to run code on real ledger")
}
msg := []byte("kuhehfeohg")

path := DerivationPath{44, 60, 0, 0, 0}

priv, err := NewPrivKeyLedgerEd25519(path)
require.Nil(t, err, "%+v", err)
pub := priv.PubKey()
sig := priv.Sign(msg)

valid := pub.VerifyBytes(msg, sig)
assert.True(t, valid)

// now, let's serialize the key and make sure it still works
bs := priv.Bytes()
priv2, err := PrivKeyFromBytes(bs)
require.Nil(t, err, "%+v", err)

// make sure we get the same pubkey when we load from disk
pub2 := priv2.PubKey()
require.Equal(t, pub, pub2)

// signing with the loaded key should match the original pubkey
sig = priv2.Sign(msg)
valid = pub.VerifyBytes(msg, sig)
assert.True(t, valid)

// make sure pubkeys serialize properly as well
bs = pub.Bytes()
bpub, err := PubKeyFromBytes(bs)
require.NoError(t, err)
assert.Equal(t, pub, bpub)
}

// TestRealLedgerErrorHandling calls. These tests assume
// the ledger is not plugged in....
func TestRealLedgerErrorHandling(t *testing.T) {
Expand Down

0 comments on commit 63aac65

Please sign in to comment.