base

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package base contains the base implementation for different sql driers.

Index

Constants

This section is empty.

Variables

This section is empty.

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 implements the service.

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 object for mutation outside of the lib.

func (Store) DatastoreForSigner

func (s Store) DatastoreForSigner(address common.Address) (datastore.Batching, error)

DatastoreForSigner gets the datastore for a given signer.

func (Store) GetQuoteResultsByStatus

func (s Store) GetQuoteResultsByStatus(ctx context.Context, matchStatuses ...db.SynapseRequestStatus) (res []db.SignRequest, err error)

GetQuoteResultsByStatus gets quote results by status.

func (Store) GlobalDatastore

func (s Store) GlobalDatastore() (datastore.Batching, error)

GlobalDatastore gets the global datastore.

func (Store) StoreInterchainTransactionReceived

func (s Store) StoreInterchainTransactionReceived(ctx context.Context, originChainID int, sr synapsemodule.SynapseModuleBatchVerificationRequested) error

StoreInterchainTransactionReceived stores an interchain transaction received.

func (Store) SubmitterDB

func (s Store) SubmitterDB() submitterDB.Service

SubmitterDB gets the submitter database object for mutation outside of the lib.

func (Store) UpdateSignRequestStatus

func (s Store) UpdateSignRequestStatus(ctx context.Context, txid common.Hash, status db.SynapseRequestStatus) error

UpdateSignRequestStatus updates a sign request status.

type VerificationRequest

type VerificationRequest struct {
	// TXHash is the hash of the transaction
	TXHash string `gorm:"column:tx_hash;index;size:256"`
	// TransactionID is the id of the transaction
	TransactionID string `gorm:"column:transaction_id;index;size:256;primaryKey"`
	// Entry is the entry to be signed
	// TODO: consider renaming to batch
	Entry string `gorm:"column:entry;"`
	// CreatedAt is the time the transaction was created
	CreatedAt time.Time
	// Status is the status of the transaction
	Status db.SynapseRequestStatus `gorm:"column:status;index"`
	// OriginChainID is the chain id the transaction hash was sent on
	OriginChainID int `gorm:"column:origin_chain_id;index"`
	// DestinationChainID is the chain id the transaction hash will be sent on
	DestinationChainID int `gorm:"column:destination_chain_id;index"`
}

VerificationRequest is a request to sign a message.

func (*VerificationRequest) ToServiceSignRequest

func (s *VerificationRequest) ToServiceSignRequest() db.SignRequest

ToServiceSignRequest converts a VerificationRequest to a db.SignRequest.

Jump to

Keyboard shortcuts

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