repo

package
v0.3.1-0...-ee1233d Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoDB = errors.Validation.NewWithKeyAndDetail("ERR_NO_DB", "no db")
)

Functions

This section is empty.

Types

type DB

type DB interface {
	DB() (*sql.DB, error)
	GormDB() *gorm.DB
}

type EventRepository

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

func NewEventRepository

func NewEventRepository(db DB) (*EventRepository, error)

func (*EventRepository) ChainDataSyncedEventByBlockNumberOrGreater

func (r *EventRepository) ChainDataSyncedEventByBlockNumberOrGreater(
	ctx context.Context,
	srcChainId uint64,
	syncedChainId uint64,
	blockNumber uint64,
) (*relayer.Event, error)

func (*EventRepository) Delete

func (r *EventRepository) Delete(
	ctx context.Context,
	id int,
) error

func (*EventRepository) DeleteAllAfterBlockID

func (r *EventRepository) DeleteAllAfterBlockID(blockID uint64, srcChainID uint64, destChainID uint64) error

DeleteAllAfterBlockID is used when a reorg is detected

func (*EventRepository) FindAllByAddress

func (r *EventRepository) FindAllByAddress(
	ctx context.Context,
	req *http.Request,
	opts relayer.FindAllByAddressOpts,
) (paginate.Page, error)

func (*EventRepository) FindLatestBlockID

func (r *EventRepository) FindLatestBlockID(
	event string,
	srcChainID uint64,
	destChainID uint64,
) (uint64, error)

GetLatestBlockID get latest block id

func (*EventRepository) FirstByEventAndMsgHash

func (r *EventRepository) FirstByEventAndMsgHash(
	ctx context.Context,
	event string,
	msgHash string,
) (*relayer.Event, error)

func (*EventRepository) FirstByMsgHash

func (r *EventRepository) FirstByMsgHash(
	ctx context.Context,
	msgHash string,
) (*relayer.Event, error)

func (*EventRepository) LatestChainDataSyncedEvent

func (r *EventRepository) LatestChainDataSyncedEvent(
	ctx context.Context,
	srcChainId uint64,
	syncedChainId uint64,
) (uint64, error)

func (*EventRepository) Save

func (*EventRepository) UpdateStatus

func (r *EventRepository) UpdateStatus(ctx context.Context, id int, status relayer.EventStatus) error

type SuspendedTransactionRepository

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

func NewSuspendedTransactionRepository

func NewSuspendedTransactionRepository(db DB) (*SuspendedTransactionRepository, error)

func (*SuspendedTransactionRepository) Find

func (*SuspendedTransactionRepository) Save

Jump to

Keyboard shortcuts

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