tendermint/account/signature.go

35 lines
754 B
Go
Raw Normal View History

package account
import (
2014-12-28 16:26:53 -08:00
"fmt"
2015-04-01 17:30:16 -07:00
"github.com/tendermint/tendermint/binary"
. "github.com/tendermint/tendermint/common"
)
// Signature is a part of Txs and consensus Votes.
type Signature interface {
}
// Types of Signature implementations
const (
SignatureTypeEd25519 = byte(0x01)
)
// for binary.readReflect
var _ = binary.RegisterInterface(
struct{ Signature }{},
2015-04-14 15:57:16 -07:00
binary.ConcreteType{SignatureEd25519{}, SignatureTypeEd25519},
)
//-------------------------------------
// Implements Signature
type SignatureEd25519 []byte
func (sig SignatureEd25519) IsNil() bool { return false }
func (sig SignatureEd25519) IsZero() bool { return len(sig) == 0 }
2014-12-28 16:26:53 -08:00
func (sig SignatureEd25519) String() string { return fmt.Sprintf("%X", Fingerprint(sig)) }