Documentation ¶
Index ¶
- type Client
- type PostgresStorage
- func (s *PostgresStorage) Add(ctx context.Context, mTx txmTypes.MonitoredTx, dbTx pgx.Tx) error
- func (s *PostgresStorage) Get(ctx context.Context, owner, id string, dbTx pgx.Tx) (txmTypes.MonitoredTx, error)
- func (s *PostgresStorage) GetBySenderAndStatus(ctx context.Context, sender common.Address, ...) ([]txmTypes.MonitoredTx, error)
- func (s *PostgresStorage) GetByStatus(ctx context.Context, owner *string, statuses []txmTypes.MonitoredTxStatus, ...) ([]txmTypes.MonitoredTx, error)
- func (s *PostgresStorage) Update(ctx context.Context, mTx txmTypes.MonitoredTx, dbTx pgx.Tx) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for eth tx manager
func New ¶
func New(cfg config.EthTxManagerConfig, ethMan aggLayerTypes.IEtherman, storage txmTypes.StorageInterface, state txmTypes.StateInterface) *Client
New creates new eth tx manager
func (*Client) Add ¶
func (c *Client) Add(ctx context.Context, owner, id string, from common.Address, to *common.Address, value *big.Int, data []byte, gasOffset uint64, dbTx pgx.Tx) error
Add a transaction to be sent and monitored
func (*Client) Result ¶
func (c *Client) Result(ctx context.Context, owner, id string, dbTx pgx.Tx) (txmTypes.MonitoredTxResult, error)
Result returns the current result of the transaction execution with all the details
type PostgresStorage ¶
PostgresStorage hold txs to be managed
func NewPostgresStorage ¶
func NewPostgresStorage(dbCfg db.Config) (*PostgresStorage, error)
NewPostgresStorage creates a new instance of storage that use postgres to store data
func (*PostgresStorage) Add ¶
func (s *PostgresStorage) Add(ctx context.Context, mTx txmTypes.MonitoredTx, dbTx pgx.Tx) error
Add persist a monitored tx
func (*PostgresStorage) Get ¶
func (s *PostgresStorage) Get(ctx context.Context, owner, id string, dbTx pgx.Tx) (txmTypes.MonitoredTx, error)
Get loads a persisted monitored tx
func (*PostgresStorage) GetBySenderAndStatus ¶
func (s *PostgresStorage) GetBySenderAndStatus( ctx context.Context, sender common.Address, statuses []txmTypes.MonitoredTxStatus, dbTx pgx.Tx) ([]txmTypes.MonitoredTx, error)
GetBySenderAndStatus loads all monitored txs of the given sender that match the provided status
func (*PostgresStorage) GetByStatus ¶
func (s *PostgresStorage) GetByStatus(ctx context.Context, owner *string, statuses []txmTypes.MonitoredTxStatus, dbTx pgx.Tx) ([]txmTypes.MonitoredTx, error)
GetByStatus loads all monitored tx that match the provided status
func (*PostgresStorage) Update ¶
func (s *PostgresStorage) Update(ctx context.Context, mTx txmTypes.MonitoredTx, dbTx pgx.Tx) error
Update a persisted monitored tx
Click to show internal directories.
Click to hide internal directories.