mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-21 07:24:36 +00:00
fixed-length arrays cleanup
This commit is contained in:
@@ -2,7 +2,6 @@ package account
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
|
||||
"github.com/tendermint/tendermint/Godeps/_workspace/src/github.com/tendermint/ed25519"
|
||||
"github.com/tendermint/tendermint/Godeps/_workspace/src/github.com/tendermint/ed25519/extra25519"
|
||||
@@ -12,7 +11,6 @@ import (
|
||||
|
||||
// PubKey is part of Account and Validator.
|
||||
type PubKey interface {
|
||||
IsNil() bool
|
||||
Address() []byte
|
||||
VerifyBytes(msg []byte, sig Signature) bool
|
||||
}
|
||||
@@ -33,8 +31,6 @@ var _ = binary.RegisterInterface(
|
||||
// Implements PubKey
|
||||
type PubKeyEd25519 [32]byte
|
||||
|
||||
func (pubKey PubKeyEd25519) IsNil() bool { return false }
|
||||
|
||||
// TODO: Or should this just be BinaryRipemd160(key)? (The difference is the TypeByte.)
|
||||
func (pubKey PubKeyEd25519) Address() []byte { return binary.BinaryRipemd160(pubKey[:]) }
|
||||
|
||||
@@ -60,14 +56,6 @@ func (pubKey PubKeyEd25519) ToCurve25519() *[32]byte {
|
||||
return keyCurve25519
|
||||
}
|
||||
|
||||
// redundant: compiler does it for us
|
||||
func (pubKey PubKeyEd25519) ValidateBasic() error {
|
||||
if len(pubKey) != ed25519.PublicKeySize {
|
||||
return errors.New("Invalid PubKeyEd25519 key size")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (pubKey PubKeyEd25519) String() string {
|
||||
return Fmt("PubKeyEd25519{%X}", pubKey[:])
|
||||
}
|
||||
|
||||
@@ -27,8 +27,6 @@ var _ = binary.RegisterInterface(
|
||||
// Implements Signature
|
||||
type SignatureEd25519 [64]byte
|
||||
|
||||
func (sig SignatureEd25519) IsNil() bool { return false }
|
||||
|
||||
func (sig SignatureEd25519) IsZero() bool { return len(sig) == 0 }
|
||||
|
||||
func (sig SignatureEd25519) String() string { return fmt.Sprintf("/%X.../", Fingerprint(sig[:])) }
|
||||
|
||||
Reference in New Issue
Block a user