base

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package base contains the base sql implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is the sqlite store. It extends the base store for sqlite specific queries.

func NewStore

func NewStore(db *gorm.DB, metrics metrics.Handler) *Store

NewStore creates a new store.

func (Store) DB

func (s Store) DB() *gorm.DB

DB gets the database.

func (Store) RetrieveExecuted

func (s Store) RetrieveExecuted(ctx context.Context, filter model.Executed) ([]model.Executed, error)

RetrieveExecuted gets a Executed event.

func (Store) RetrieveLastStoredBlock

func (s Store) RetrieveLastStoredBlock(ctx context.Context, chainID uint32, address common.Address) (uint64, error)

RetrieveLastStoredBlock gets the last stored block.

func (Store) RetrieveMessageStatus

func (s Store) RetrieveMessageStatus(ctx context.Context, messageHash string) (graphqlModel.MessageStatus, error)

RetrieveMessageStatus retrieve message status.

func (Store) RetrieveMessagesByStatus added in v0.0.5

func (s Store) RetrieveMessagesByStatus(ctx context.Context, messageStatus graphqlModel.MessageState, page int) ([]*graphqlModel.MessageStatus, error)

RetrieveMessagesByStatus retrieves pending messages.

func (Store) RetrieveOriginSent

func (s Store) RetrieveOriginSent(ctx context.Context, filter model.OriginSent) ([]model.OriginSent, error)

RetrieveOriginSent gets the Origin Sent event.

func (Store) StoreExecuted

func (s Store) StoreExecuted(ctx context.Context, executedEvent *model.Executed) error

StoreExecuted stores an origin event.

func (Store) StoreLastIndexed

func (s Store) StoreLastIndexed(parentCtx context.Context, contractAddress common.Address, chainID uint32, blockNumber uint64) (err error)

StoreLastIndexed stores the last indexed block number for a contract.

func (Store) StoreOrUpdateMessageStatus

func (s Store) StoreOrUpdateMessageStatus(ctx context.Context, txHash string, messageHash string, messageType types.MessageType) error

StoreOrUpdateMessageStatus stores or updates the message status.

func (Store) StoreOriginSent

func (s Store) StoreOriginSent(ctx context.Context, originSent *model.OriginSent) error

StoreOriginSent stores an origin event.

func (Store) UNSAFE_DB

func (s Store) UNSAFE_DB() *gorm.DB

UNSAFE_DB gets the underlying gorm db. This is for use only for testing.

Jump to

Keyboard shortcuts

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