db

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggSenderSQLStorage

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

AggSenderSQLStorage is the struct that implements the AggSenderStorage interface

func NewAggSenderSQLStorage

func NewAggSenderSQLStorage(logger *log.Logger, dbPath string) (*AggSenderSQLStorage, error)

NewAggSenderSQLStorage creates a new AggSenderSQLStorage

func (*AggSenderSQLStorage) DeleteCertificate

func (a *AggSenderSQLStorage) DeleteCertificate(ctx context.Context, certificateID common.Hash) error

DeleteCertificate deletes a certificate from the storage

func (*AggSenderSQLStorage) GetCertificateByHeight

func (a *AggSenderSQLStorage) GetCertificateByHeight(height uint64) (types.CertificateInfo, error)

GetCertificateByHeight returns a certificate by its height

func (*AggSenderSQLStorage) GetCertificatesByStatus

func (a *AggSenderSQLStorage) GetCertificatesByStatus(
	statuses []agglayer.CertificateStatus) ([]*types.CertificateInfo, error)

func (*AggSenderSQLStorage) GetLastSentCertificate

func (a *AggSenderSQLStorage) GetLastSentCertificate() (types.CertificateInfo, error)

GetLastSentCertificate returns the last certificate sent to the aggLayer

func (*AggSenderSQLStorage) SaveLastSentCertificate

func (a *AggSenderSQLStorage) SaveLastSentCertificate(ctx context.Context, certificate types.CertificateInfo) error

SaveLastSentCertificate saves the last certificate sent to the aggLayer

func (*AggSenderSQLStorage) UpdateCertificateStatus

func (a *AggSenderSQLStorage) UpdateCertificateStatus(ctx context.Context, certificate types.CertificateInfo) error

UpdateCertificateStatus updates the status of a certificate

type AggSenderStorage

type AggSenderStorage interface {
	// GetCertificateByHeight returns a certificate by its height
	GetCertificateByHeight(height uint64) (types.CertificateInfo, error)
	// GetLastSentCertificate returns the last certificate sent to the aggLayer
	GetLastSentCertificate() (types.CertificateInfo, error)
	// SaveLastSentCertificate saves the last certificate sent to the aggLayer
	SaveLastSentCertificate(ctx context.Context, certificate types.CertificateInfo) error
	// DeleteCertificate deletes a certificate from the storage
	DeleteCertificate(ctx context.Context, certificateID common.Hash) error
	// GetCertificatesByStatus returns a list of certificates by their status
	GetCertificatesByStatus(status []agglayer.CertificateStatus) ([]*types.CertificateInfo, error)
	// UpdateCertificateStatus updates the status of a certificate
	UpdateCertificateStatus(ctx context.Context, certificate types.CertificateInfo) error
}

AggSenderStorage is the interface that defines the methods to interact with the storage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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