Documentation
¶
Index ¶
- Variables
- func GenerateMessageIdByNonce(nonce int64) *common.Hash
- type MemorySequencer
- func (s *MemorySequencer) Close()
- func (s *MemorySequencer) PeekMsg() (Request, error)
- func (s *MemorySequencer) PendingMsgCount() (int, error)
- func (s *MemorySequencer) PopMsg() (Request, error)
- func (s *MemorySequencer) PushMsg(msg Request) error
- func (s *MemorySequencer) QueuedMsgCount() (int, error)
- type MemoryStorage
- func (s *MemoryStorage) AddMsg(req Request) error
- func (s *MemoryStorage) GetMsg(msgId common.Hash) (Message, error)
- func (s *MemoryStorage) HasMsg(msgId common.Hash) bool
- func (s *MemoryStorage) UpdateMsg(msg Message) error
- func (s *MemoryStorage) UpdateMsgStatus(msgId common.Hash, status MessageStatus) error
- func (s *MemoryStorage) UpdateResponse(msgId common.Hash, resp Response) error
- type Message
- type MessageStatus
- type Request
- type Response
- type Sequencer
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPendingChannelClosed = errors.New("pending channel was closed")
Functions ¶
Types ¶
type MemorySequencer ¶
type MemorySequencer struct {
// contains filtered or unexported fields
}
func NewMemorySequencer ¶
func NewMemorySequencer(client *ethclient.Client, msgStorage Storage, buffer int) *MemorySequencer
func (*MemorySequencer) Close ¶
func (s *MemorySequencer) Close()
func (*MemorySequencer) PeekMsg ¶
func (s *MemorySequencer) PeekMsg() (Request, error)
func (*MemorySequencer) PendingMsgCount ¶
func (s *MemorySequencer) PendingMsgCount() (int, error)
func (*MemorySequencer) PopMsg ¶
func (s *MemorySequencer) PopMsg() (Request, error)
func (*MemorySequencer) PushMsg ¶
func (s *MemorySequencer) PushMsg(msg Request) error
func (*MemorySequencer) QueuedMsgCount ¶
func (s *MemorySequencer) QueuedMsgCount() (int, error)
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
func NewMemoryStorage ¶
func NewMemoryStorage() (*MemoryStorage, error)
func (*MemoryStorage) AddMsg ¶
func (s *MemoryStorage) AddMsg(req Request) error
func (*MemoryStorage) UpdateMsg ¶
func (s *MemoryStorage) UpdateMsg(msg Message) error
func (*MemoryStorage) UpdateMsgStatus ¶
func (s *MemoryStorage) UpdateMsgStatus(msgId common.Hash, status MessageStatus) error
func (*MemoryStorage) UpdateResponse ¶
func (s *MemoryStorage) UpdateResponse(msgId common.Hash, resp Response) error
type Message ¶
type MessageStatus ¶
type MessageStatus uint8
const ( MessageStatusSubmitted MessageStatus = iota MessageStatusScheduled MessageStatusQueued MessageStatusNonceAssigned MessageStatusInflight // Broadcasted but not on chain MessageStatusOnChain MessageStatusFinalized // it was broadcasted but not included on-chain until timeout, so the nonce was released MessageStatusNonceReleased MessageStatusExpired )
type Request ¶
type Request struct {
From common.Address // the sender of the 'transaction'
To *common.Address // the destination contract (nil for contract creation)
Value *big.Int // amount of wei sent along with the call
Gas uint64 // if 0, the call executes with near-infinite gas
GasOnEstimationFailed *uint64 // how much gas you wanna provide when the msg estimation failed. As much as possible, so you can debug on-chain
GasPrice *big.Int // wei <-> gas exchange ratio
Data []byte // input data, usually an ABI-encoded contract method invocation
AccessList types.AccessList // EIP-2930 access list.
SimulationOn bool // contains return data of msg call if true
// ONLY available on function ScheduleMsg
AfterMsg *common.Hash // message id or txHash. Used for making sure the msg was executed after it.
StartTime int64 // the msg was executed after the time. It's useful for one-time task.
ExpirationTime int64 // the msg will be not included on-chain if timeout.
Interval time.Duration // the msg will be executed every interval.
// contains filtered or unexported fields
}
func AssignMessageId ¶
func (*Request) SetIdWithNonce ¶
Click to show internal directories.
Click to hide internal directories.