mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 06:31:57 +00:00
KeyString() in PubKey; Fix tests
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
|||||||
// PubKey is part of Account and Validator.
|
// PubKey is part of Account and Validator.
|
||||||
type PubKey interface {
|
type PubKey interface {
|
||||||
Address() []byte
|
Address() []byte
|
||||||
|
KeyString() string
|
||||||
VerifyBytes(msg []byte, sig Signature) bool
|
VerifyBytes(msg []byte, sig Signature) bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -42,7 +42,7 @@ func TestBinaryDecode(t *testing.T) {
|
|||||||
sig := privKey.Sign(msg)
|
sig := privKey.Sign(msg)
|
||||||
t.Logf("msg: %X, sig: %X", msg, sig)
|
t.Logf("msg: %X, sig: %X", msg, sig)
|
||||||
|
|
||||||
buf, n, err := new(bytes.Buffer), new(int64), new(error)
|
buf, n, err := new(bytes.Buffer), new(int), new(error)
|
||||||
wire.WriteBinary(sig, buf, n, err)
|
wire.WriteBinary(sig, buf, n, err)
|
||||||
if *err != nil {
|
if *err != nil {
|
||||||
t.Fatalf("Failed to write Signature: %v", err)
|
t.Fatalf("Failed to write Signature: %v", err)
|
||||||
@@ -56,7 +56,7 @@ func TestBinaryDecode(t *testing.T) {
|
|||||||
t.Fatalf("Unexpected signature type byte")
|
t.Fatalf("Unexpected signature type byte")
|
||||||
}
|
}
|
||||||
|
|
||||||
sig2, ok := wire.ReadBinary(SignatureEd25519{}, buf, n, err).(SignatureEd25519)
|
sig2, ok := wire.ReadBinary(SignatureEd25519{}, buf, 0, n, err).(SignatureEd25519)
|
||||||
if !ok || *err != nil {
|
if !ok || *err != nil {
|
||||||
t.Fatalf("Failed to read Signature: %v", err)
|
t.Fatalf("Failed to read Signature: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user