Browse Source

KeyString() in PubKey; Fix tests

pull/1782/head
Jae Kwon 9 years ago
parent
commit
372191dd5f
2 changed files with 3 additions and 2 deletions
  1. +1
    -0
      pub_key.go
  2. +2
    -2
      signature_test.go

+ 1
- 0
pub_key.go View File

@ -13,6 +13,7 @@ import (
// PubKey is part of Account and Validator.
type PubKey interface {
Address() []byte
KeyString() string
VerifyBytes(msg []byte, sig Signature) bool
}


+ 2
- 2
signature_test.go View File

@ -42,7 +42,7 @@ func TestBinaryDecode(t *testing.T) {
sig := privKey.Sign(msg)
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)
if *err != nil {
t.Fatalf("Failed to write Signature: %v", err)
@ -56,7 +56,7 @@ func TestBinaryDecode(t *testing.T) {
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 {
t.Fatalf("Failed to read Signature: %v", err)
}


Loading…
Cancel
Save