Documentation ¶
Index ¶
- func SigningBytes(msg *types.Message, sigType crypto.SigType) ([]byte, error)
- type MessageSigner
- func (ms *MessageSigner) GetSignedMessage(ctx context.Context, uuid uuid.UUID) (*types.SignedMessage, error)
- func (ms *MessageSigner) NextNonce(ctx context.Context, addr address.Address) (uint64, error)
- func (ms *MessageSigner) SaveNonce(ctx context.Context, addr address.Address, nonce uint64) error
- func (ms *MessageSigner) SignMessage(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, ...) (*types.SignedMessage, error)
- func (ms *MessageSigner) StoreSignedMessage(ctx context.Context, uuid uuid.UUID, message *types.SignedMessage) error
- type MessageSignerConsensus
- func (ms *MessageSignerConsensus) GetRaftState(ctx context.Context) (*consensus.RaftState, error)
- func (ms *MessageSignerConsensus) GetSignedMessage(ctx context.Context, uuid uuid.UUID) (*types.SignedMessage, error)
- func (ms *MessageSignerConsensus) IsLeader(ctx context.Context) bool
- func (ms *MessageSignerConsensus) Leader(ctx context.Context) (peer.ID, error)
- func (ms *MessageSignerConsensus) RedirectToLeader(ctx context.Context, method string, arg interface{}, ret interface{}) (bool, error)
- func (ms *MessageSignerConsensus) SignMessage(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, ...) (*types.SignedMessage, error)
- type MsgSigner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MessageSigner ¶
type MessageSigner struct {
// contains filtered or unexported fields
}
MessageSigner keeps track of nonces per address, and increments the nonce when signing a message
func NewMessageSigner ¶
func NewMessageSigner(wallet api.Wallet, mpool messagepool.MpoolNonceAPI, ds dtypes.MetadataDS) *MessageSigner
func (*MessageSigner) GetSignedMessage ¶ added in v1.17.2
func (ms *MessageSigner) GetSignedMessage(ctx context.Context, uuid uuid.UUID) (*types.SignedMessage, error)
func (*MessageSigner) NextNonce ¶ added in v1.19.0
func (ms *MessageSigner) NextNonce(ctx context.Context, addr address.Address) (uint64, error)
NextNonce gets the next nonce for the given address. If there is no nonce in the datastore, gets the nonce from the message pool.
func (*MessageSigner) SaveNonce ¶ added in v1.19.0
func (ms *MessageSigner) SaveNonce(ctx context.Context, addr address.Address, nonce uint64) error
SaveNonce increments the nonce for this address and writes it to the datastore
func (*MessageSigner) SignMessage ¶
func (ms *MessageSigner) SignMessage(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, cb func(*types.SignedMessage) error) (*types.SignedMessage, error)
SignMessage increments the nonce for the message From address, and signs the message
func (*MessageSigner) StoreSignedMessage ¶ added in v1.17.2
func (ms *MessageSigner) StoreSignedMessage(ctx context.Context, uuid uuid.UUID, message *types.SignedMessage) error
type MessageSignerConsensus ¶ added in v1.19.0
func NewMessageSignerConsensus ¶ added in v1.19.0
func NewMessageSignerConsensus( wallet api.Wallet, mpool messagepool.MpoolNonceAPI, ds dtypes.MetadataDS, consensus *consensus.Consensus) *MessageSignerConsensus
func (*MessageSignerConsensus) GetRaftState ¶ added in v1.19.0
func (*MessageSignerConsensus) GetSignedMessage ¶ added in v1.19.0
func (ms *MessageSignerConsensus) GetSignedMessage(ctx context.Context, uuid uuid.UUID) (*types.SignedMessage, error)
func (*MessageSignerConsensus) IsLeader ¶ added in v1.19.0
func (ms *MessageSignerConsensus) IsLeader(ctx context.Context) bool
func (*MessageSignerConsensus) RedirectToLeader ¶ added in v1.19.0
func (*MessageSignerConsensus) SignMessage ¶ added in v1.19.0
func (ms *MessageSignerConsensus) SignMessage( ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, cb func(*types.SignedMessage) error) (*types.SignedMessage, error)
type MsgSigner ¶ added in v1.19.0
type MsgSigner interface { SignMessage(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, cb func(*types.SignedMessage) error) (*types.SignedMessage, error) GetSignedMessage(ctx context.Context, uuid uuid.UUID) (*types.SignedMessage, error) StoreSignedMessage(ctx context.Context, uuid uuid.UUID, message *types.SignedMessage) error NextNonce(ctx context.Context, addr address.Address) (uint64, error) SaveNonce(ctx context.Context, addr address.Address, nonce uint64) error }
Click to show internal directories.
Click to hide internal directories.