dal

package
v0.0.0-...-77861b7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AND = "AND"
	OR  = "OR"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sqldb.Db
}

func GetDB

func GetDB() *DB

func InitDB

func InitDB() *DB

func (*DB) GetExecutionRecord

func (db *DB) GetExecutionRecord(q *ExecutionRecordQuery) (*models.ExecutionRecord, error)

func (*DB) GetExecutionRecordByID

func (db *DB) GetExecutionRecordByID(id []byte) *models.ExecutionRecord

func (*DB) GetExecutionRecords

func (db *DB) GetExecutionRecords(q *ExecutionRecordsQuery) ([]*models.ExecutionRecord, error)

func (*DB) GetExecutionRecordsToExecute

func (db *DB) GetExecutionRecordsToExecute() []*models.ExecutionRecord

func (*DB) GetMonitorBlock

func (dal *DB) GetMonitorBlock(key string) (blknum uint64, blkidx int64, found bool, err error)

func (*DB) IncrAttemptAndRevert

func (db *DB) IncrAttemptAndRevert(id []byte, revertStatus types.ExecutionStatus) error

func (*DB) IncreaseRetryCount

func (db *DB) IncreaseRetryCount(id []byte) (newCount uint64)

func (*DB) RevertStatus

func (db *DB) RevertStatus(id []byte, status types.ExecutionStatus) error

func (*DB) SaveExecutionContext

func (db *DB) SaveExecutionContext(execCtx *msgtypes.ExecutionContext) error

func (*DB) SaveExecutionContexts

func (db *DB) SaveExecutionContexts(execCtxs []*msgtypes.ExecutionContext)

func (*DB) SetMonitorBlock

func (dal *DB) SetMonitorBlock(key string, blockNum uint64, blockIdx int64) error

func (*DB) UpdateExecCtx

func (db *DB) UpdateExecCtx(id []byte, execCtx *msgtypes.ExecutionContext) error

func (*DB) UpdateRetryCount

func (db *DB) UpdateRetryCount(id []byte, retryCount uint64)

func (*DB) UpdateStatus

func (db *DB) UpdateStatus(id []byte, status types.ExecutionStatus) error

UpdateStatus updates the execution status of a message. `id` is computed differently for each type of message: message associated with peg mint: id = mintId = hash(account, token, amount, depositor, refChainId, refId) message associated with peg withdraw: id = mintId, same as peg mint message associated with liquidity send: id = dstTransferId = hash(sender, receiver, token, amount, srcChainId, dstChainId, srcTransferId) message associated with liquidity withdraw: id = wdId = hash(chainid, seqnum, receiver, token, amount) all above ids are again hashed with bridge address id = hash(bridgeAddr, id) no transfer associated: id = messageId

func (*DB) UpdateTx

func (db *DB) UpdateTx(id []byte, tx common.Hash) error

type ExecutionRecordQuery

type ExecutionRecordQuery struct {
	ID    []byte
	SrcTx string
	DstTx string
}

type ExecutionRecordsQuery

type ExecutionRecordsQuery struct {
	SrcTx    string
	Statuses []int
}

type WhereBuilder

type WhereBuilder struct {
	// contains filtered or unexported fields
}

func (*WhereBuilder) And

func (w *WhereBuilder) And(expr string, args ...interface{}) *WhereBuilder

func (*WhereBuilder) Build

func (w *WhereBuilder) Build() string

func (*WhereBuilder) Or

func (w *WhereBuilder) Or(expr string, args ...interface{}) *WhereBuilder

func (*WhereBuilder) String

func (w *WhereBuilder) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL