base

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 15 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 store.

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) GetDeadlineQueueEvents

func (s Store) GetDeadlineQueueEvents(ctx context.Context) ([]*model.DeadlineQueue, error)

GetDeadlineQueueEvents gets all events in the deadline queue table.

func (Store) GetDestinationBridgeEvent

func (s Store) GetDestinationBridgeEvent(ctx context.Context, transactionID string) (*model.DestinationBridgeEvent, error)

GetDestinationBridgeEvent gets a destination bridge event.

func (Store) GetLastIndexed

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

GetLastIndexed gets the last indexed block by contract.

func (Store) GetOriginBridgeEvent

func (s Store) GetOriginBridgeEvent(ctx context.Context, transactionID string) (*model.OriginBridgeEvent, error)

GetOriginBridgeEvent gets a origin bridge event.

func (Store) GetToken

func (s Store) GetToken(ctx context.Context, tokenID string) (*model.Token, error)

GetToken gets a token's metadata with a token's ID.

func (Store) RemoveDeadlineQueueEvent

func (s Store) RemoveDeadlineQueueEvent(ctx context.Context, transactionID string) error

RemoveDeadlineQueueEvent removes an event from the deadline queue table.

func (Store) StoreDeadlineQueueEvent

func (s Store) StoreDeadlineQueueEvent(ctx context.Context, entry *model.DeadlineQueue) error

StoreDeadlineQueueEvent inserts a deadline queue entry if it does not exist in the table.

func (Store) StoreDestinationBridgeEvent

func (s Store) StoreDestinationBridgeEvent(ctx context.Context, log *types.Log, originEvent *model.OriginBridgeEvent) error

StoreDestinationBridgeEvent adds a new destination to the database.

func (Store) StoreLastIndexed

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

StoreLastIndexed stores the last indexed block number for a contract. It will only insert if the current stored block number is less than the block number being inserted.

func (Store) StoreOriginBridgeEvent

func (s Store) StoreOriginBridgeEvent(ctx context.Context, chainID uint32, log *types.Log, event *bindings.FastBridgeBridgeRequested) error

StoreOriginBridgeEvent adds a new origin event to the database.

func (Store) StoreToken

func (s Store) StoreToken(ctx context.Context, token *model.Token) error

StoreToken is an UPSERT operation that updates the token metadata if it exists, or inserts it if it doesn't.

func (Store) SubmitterDB

func (s Store) SubmitterDB() submitterDB.Service

SubmitterDB gets the submitter database object for mutation.

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