mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-25 18:51:39 +00:00
Test ledger calls
This commit is contained in:
@ -48,7 +48,10 @@ type PrivKeyLedger struct {
|
|||||||
pubKey crypto.PubKey
|
pubKey crypto.PubKey
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ crypto.PrivKeyInner = &PrivKeyLedger{}
|
func NewPrivKeyLedger() crypto.PrivKey {
|
||||||
|
var pk PrivKeyLedger
|
||||||
|
return pk.Wrap()
|
||||||
|
}
|
||||||
|
|
||||||
// AssertIsPrivKeyInner fulfils PrivKey Interface
|
// AssertIsPrivKeyInner fulfils PrivKey Interface
|
||||||
func (pk *PrivKeyLedger) AssertIsPrivKeyInner() {}
|
func (pk *PrivKeyLedger) AssertIsPrivKeyInner() {}
|
||||||
|
@ -77,5 +77,13 @@ func TestRealLedger(t *testing.T) {
|
|||||||
if os.Getenv("WITH_LEDGER") == "" {
|
if os.Getenv("WITH_LEDGER") == "" {
|
||||||
t.Skip("Set WITH_LEDGER to run code on real ledger")
|
t.Skip("Set WITH_LEDGER to run code on real ledger")
|
||||||
}
|
}
|
||||||
// let's try for real....
|
|
||||||
|
priv := NewPrivKeyLedger()
|
||||||
|
msg := []byte("kuhehfeohg")
|
||||||
|
|
||||||
|
sig := priv.Sign(msg)
|
||||||
|
pub := priv.PubKey()
|
||||||
|
|
||||||
|
valid := pub.VerifyBytes(msg, sig)
|
||||||
|
assert.True(t, valid)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user