mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
35 lines
713 B
Go
35 lines
713 B
Go
|
package account
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"github.com/tendermint/go-wire"
|
||
|
. "github.com/tendermint/go-common"
|
||
|
)
|
||
|
|
||
|
// Signature is a part of Txs and consensus Votes.
|
||
|
type Signature interface {
|
||
|
IsZero() bool
|
||
|
String() string
|
||
|
}
|
||
|
|
||
|
// Types of Signature implementations
|
||
|
const (
|
||
|
SignatureTypeEd25519 = byte(0x01)
|
||
|
)
|
||
|
|
||
|
// for wire.readReflect
|
||
|
var _ = wire.RegisterInterface(
|
||
|
struct{ Signature }{},
|
||
|
wire.ConcreteType{SignatureEd25519{}, SignatureTypeEd25519},
|
||
|
)
|
||
|
|
||
|
//-------------------------------------
|
||
|
|
||
|
// Implements Signature
|
||
|
type SignatureEd25519 [64]byte
|
||
|
|
||
|
func (sig SignatureEd25519) IsZero() bool { return len(sig) == 0 }
|
||
|
|
||
|
func (sig SignatureEd25519) String() string { return fmt.Sprintf("/%X.../", Fingerprint(sig[:])) }
|