Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
// Sign signs a message with multiple signers
Sign(ctx context.Context, msg *warp.UnsignedMessage, signerIndices []int) (*warp.Message, error)
// GetValidators returns the current validator set
GetValidators(ctx context.Context) ([]*warp.Validator, error)
}
Backend is an interface for signing backends
type LocalSigner ¶
type LocalSigner struct {
// contains filtered or unexported fields
}
LocalSigner signs messages with a local secret key
func NewLocalSigner ¶
func NewLocalSigner(sk *bls.SecretKey) *LocalSigner
NewLocalSigner creates a new local signer
func (*LocalSigner) GetPublicKey ¶
func (s *LocalSigner) GetPublicKey() *bls.PublicKey
GetPublicKey returns the public key
func (*LocalSigner) Sign ¶
func (s *LocalSigner) Sign(msg *warp.UnsignedMessage) (*bls.Signature, error)
Sign signs a message
type RemoteSigner ¶
type RemoteSigner struct {
// contains filtered or unexported fields
}
RemoteSigner signs messages via RPC
func NewRemoteSigner ¶
func NewRemoteSigner(client SignerClient) (*RemoteSigner, error)
NewRemoteSigner creates a new remote signer
func (*RemoteSigner) GetPublicKey ¶
func (s *RemoteSigner) GetPublicKey() *bls.PublicKey
GetPublicKey returns the public key
func (*RemoteSigner) Sign ¶
func (s *RemoteSigner) Sign(msg *warp.UnsignedMessage) (*bls.Signature, error)
Sign signs a message
type Signer ¶
type Signer interface {
// Sign signs a message
Sign(msg *warp.UnsignedMessage) (*bls.Signature, error)
// GetPublicKey returns the public key
GetPublicKey() *bls.PublicKey
}
Signer is an interface for signing warp messages
type SignerBackend ¶
type SignerBackend struct {
// contains filtered or unexported fields
}
SignerBackend manages multiple signers
func NewSignerBackend ¶
func NewSignerBackend(validators []*warp.Validator) *SignerBackend
NewSignerBackend creates a new signer backend
func (*SignerBackend) AddSigner ¶
func (b *SignerBackend) AddSigner(index int, signer Signer) error
AddSigner adds a signer for a validator
func (*SignerBackend) GetValidators ¶
GetValidators returns the current validator set
Click to show internal directories.
Click to hide internal directories.