storage

package
v0.0.0-...-ce1b770 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDocNotFound = errors.New("NOT FOUND")

repository errors

Functions

This section is empty.

Types

type DestinationTx

type DestinationTx struct {
	ChainID     vaa.ChainID `bson:"chainId"`
	Status      string      `bson:"status"`
	Method      string      `bson:"method"`
	TxHash      string      `bson:"txHash"`
	From        string      `bson:"from"`
	To          string      `bson:"to"`
	BlockNumber string      `bson:"blockNumber"`
	Timestamp   *time.Time  `bson:"timestamp"`
	UpdatedAt   *time.Time  `bson:"updatedAt"`
}

DestinationTx representa a destination transaction.

type Repository

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

Repository definitions.

func NewRepository

func NewRepository(db *mongo.Database, metrics metrics.Metrics, alerts alert.AlertClient, log *zap.Logger) *Repository

NewRepository create a new respository instance.

func (*Repository) GetCurrentBlock

func (s *Repository) GetCurrentBlock(ctx context.Context, blockchain string, defaultBlock int64) (int64, error)

func (*Repository) GetGlobalTransactionByID

func (s *Repository) GetGlobalTransactionByID(ctx context.Context, id string) (TransactionUpdate, error)

func (*Repository) UpdateWatcherBlock

func (s *Repository) UpdateWatcherBlock(ctx context.Context, chainID sdk.ChainID, watcherBlock WatcherBlock) error

func (*Repository) UpsertGlobalTransaction

func (s *Repository) UpsertGlobalTransaction(ctx context.Context, chainID sdk.ChainID, globalTx TransactionUpdate) error

type TransactionUpdate

type TransactionUpdate struct {
	ID          string        `bson:"_id"`
	Destination DestinationTx `bson:"destinationTx"`
}

TransactionUpdate represents a transaction document.

func (*TransactionUpdate) ToMap

func (t *TransactionUpdate) ToMap() map[string]string

type WatcherBlock

type WatcherBlock struct {
	ID          string    `bson:"_id"`
	BlockNumber int64     `bson:"blockNumber"`
	UpdatedAt   time.Time `bson:"updatedAt"`
}

Jump to

Keyboard shortcuts

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