Documentation ¶
Overview ¶
Package base contains the base sql implementation
Index ¶
- Variables
- func GetAllModels() (allModels []interface{})
- type Store
- func (s Store) DB() *gorm.DB
- func (s Store) GetLastBlockNumber(ctx context.Context, chainID uint32) (uint64, error)
- func (s Store) GetMessageByHash(ctx context.Context, messageHash common.Hash) (*types.Message, error)
- func (s Store) GetMessageByOriginHash(ctx context.Context, originHash common.Hash) (*types.Message, error)
- func (s Store) GetMessageByRequestID(ctx context.Context, requestID string) (*types.Message, error)
- func (s Store) GetMessagesByState(ctx context.Context, states ...types.MessageState) ([]types.Message, error)
- func (s Store) StoreMessage(ctx context.Context, msg types.Message) error
- func (s Store) SubmitterDB() submitterDB.Service
Constants ¶
This section is empty.
Variables ¶
var ( // OriginTxHashFieldName gets the burn tx hash field name. OriginTxHashFieldName string // DestTxHashFieldName gets the burn tx hash field name. DestTxHashFieldName string // NonceFieldName gets the mint tx hash field name. NonceFieldName string // OriginChainIDFieldName gets the origin chain ID field name. OriginChainIDFieldName string // DestChainIDFieldName gets the destination chain ID field name. DestChainIDFieldName string // MessageFieldName gets the message field name. MessageFieldName string // MessageHashFieldName gets the message hash field name. MessageHashFieldName string // AttestationFieldName gets the signature field name. AttestationFieldName string // RequestVersionFieldName gets the request version field name. RequestVersionFieldName string // FormattedRequestFieldName gets the formatted request field name. FormattedRequestFieldName string // RequestIDFieldName gets the request id field name. RequestIDFieldName string // BlockNumberFieldName gets the block number field name. BlockNumberFieldName string // StateFieldName gets the state field name. StateFieldName string )
Functions ¶
func GetAllModels ¶
func GetAllModels() (allModels []interface{})
GetAllModels gets all models to migrate. see: https://medium.com/@SaifAbid/slice-interfaces-8c78f8b6345d for an explanation of why we can't do this at initialization time
Types ¶
type Store ¶
type Store struct { listenerDB.ChainListenerDB // contains filtered or unexported fields }
Store is a store that implements an underlying gorm db.
func (Store) GetLastBlockNumber ¶
GetLastBlockNumber gets the last block number that had a message in the database.
func (Store) GetMessageByHash ¶ added in v0.2.0
func (s Store) GetMessageByHash(ctx context.Context, messageHash common.Hash) (*types.Message, error)
GetMessageByHash gets a message by its message hash.
func (Store) GetMessageByOriginHash ¶
func (s Store) GetMessageByOriginHash(ctx context.Context, originHash common.Hash) (*types.Message, error)
GetMessageByOriginHash gets a message by its origin hash. TODO: this is actually non-unique, but we only return 1.
func (Store) GetMessageByRequestID ¶ added in v0.0.9
GetMessageByRequestID gets a message by its request id.
func (Store) GetMessagesByState ¶
func (s Store) GetMessagesByState(ctx context.Context, states ...types.MessageState) ([]types.Message, error)
GetMessagesByState gets messages by state.
func (Store) StoreMessage ¶
StoreMessage stores a message in the database.
func (Store) SubmitterDB ¶
func (s Store) SubmitterDB() submitterDB.Service
SubmitterDB gets the submitter database object for mutation outside of the lib.