|
@ -9,6 +9,7 @@ import ( |
|
|
|
|
|
|
|
|
// Signature is a part of Txs and consensus Votes.
|
|
|
// Signature is a part of Txs and consensus Votes.
|
|
|
type Signature interface { |
|
|
type Signature interface { |
|
|
|
|
|
Bytes() []byte |
|
|
IsZero() bool |
|
|
IsZero() bool |
|
|
String() string |
|
|
String() string |
|
|
} |
|
|
} |
|
@ -29,6 +30,10 @@ var _ = wire.RegisterInterface( |
|
|
// Implements Signature
|
|
|
// Implements Signature
|
|
|
type SignatureEd25519 [64]byte |
|
|
type SignatureEd25519 [64]byte |
|
|
|
|
|
|
|
|
|
|
|
func (sig SignatureEd25519) Bytes() []byte { |
|
|
|
|
|
return wire.BinaryBytes(struct{ Signature }{sig}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
func (sig SignatureEd25519) IsZero() bool { return len(sig) == 0 } |
|
|
func (sig SignatureEd25519) IsZero() bool { return len(sig) == 0 } |
|
|
|
|
|
|
|
|
func (sig SignatureEd25519) String() string { return fmt.Sprintf("/%X.../", Fingerprint(sig[:])) } |
|
|
func (sig SignatureEd25519) String() string { return fmt.Sprintf("/%X.../", Fingerprint(sig[:])) } |