dao

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BSCDao

type BSCDao struct {
	DB *gorm.DB
}

func NewBSCDao

func NewBSCDao(db *gorm.DB) *BSCDao

func (*BSCDao) DeleteBlockAndPackagesAtHeight

func (d *BSCDao) DeleteBlockAndPackagesAtHeight(height uint64) error

func (*BSCDao) GetAllVotedPackages

func (d *BSCDao) GetAllVotedPackages(sequence uint64) ([]*model.BscRelayPackage, error)

func (*BSCDao) GetLatestBlock

func (d *BSCDao) GetLatestBlock() (*model.BscBlock, error)

func (*BSCDao) GetLeastSavedPackagesHeight

func (d *BSCDao) GetLeastSavedPackagesHeight() (uint64, error)

func (*BSCDao) GetPackagesByStatus

func (d *BSCDao) GetPackagesByStatus(status db.TxStatus) ([]*model.BscRelayPackage, error)

func (*BSCDao) GetPackagesByStatusAndHeight

func (d *BSCDao) GetPackagesByStatusAndHeight(status db.TxStatus, height uint64) ([]*model.BscRelayPackage, error)

func (*BSCDao) SaveBatchPackages

func (d *BSCDao) SaveBatchPackages(pkgs []*model.BscRelayPackage) error

func (*BSCDao) SaveBlockAndBatchPackages

func (d *BSCDao) SaveBlockAndBatchPackages(b *model.BscBlock, pkgs []*model.BscRelayPackage) error

func (*BSCDao) UpdateBatchPackagesStatus

func (d *BSCDao) UpdateBatchPackagesStatus(txIds []int64, status db.TxStatus) error

func (*BSCDao) UpdateBatchPackagesStatusAndClaimedTxHash

func (d *BSCDao) UpdateBatchPackagesStatusAndClaimedTxHash(txIds []int64, status db.TxStatus, claimTxHash string) error

type DaoManager

type DaoManager struct {
	GreenfieldDao *GreenfieldDao
	VoteDao       *VoteDao
	BSCDao        *BSCDao
}

func NewDaoManager

func NewDaoManager(greenfieldDao *GreenfieldDao, bscDao *BSCDao, voteDao *VoteDao) *DaoManager

type GreenfieldDao

type GreenfieldDao struct {
	DB *gorm.DB
}

func NewGreenfieldDao

func NewGreenfieldDao(db *gorm.DB) *GreenfieldDao

func (*GreenfieldDao) GetLatestBlock

func (d *GreenfieldDao) GetLatestBlock() (*model.GreenfieldBlock, error)

func (*GreenfieldDao) GetLatestVotedTransactionHeight

func (d *GreenfieldDao) GetLatestVotedTransactionHeight() (uint64, error)

func (*GreenfieldDao) GetLeastSavedTransactionHeight

func (d *GreenfieldDao) GetLeastSavedTransactionHeight() (uint64, error)

func (*GreenfieldDao) GetTransactionByChannelIdAndSequenceAndStatus

func (d *GreenfieldDao) GetTransactionByChannelIdAndSequenceAndStatus(channelId types.ChannelId, sequence uint64, status db.TxStatus) (*model.GreenfieldRelayTransaction, error)

func (*GreenfieldDao) GetTransactionsByStatus

func (d *GreenfieldDao) GetTransactionsByStatus(s db.TxStatus) ([]*model.GreenfieldRelayTransaction, error)

func (*GreenfieldDao) GetTransactionsByStatusAndHeight

func (d *GreenfieldDao) GetTransactionsByStatusAndHeight(status db.TxStatus, height uint64) ([]*model.GreenfieldRelayTransaction, error)

func (*GreenfieldDao) SaveBlockAndBatchTransactions

func (d *GreenfieldDao) SaveBlockAndBatchTransactions(b *model.GreenfieldBlock, txs []*model.GreenfieldRelayTransaction) error

func (*GreenfieldDao) UpdateTransactionStatus

func (d *GreenfieldDao) UpdateTransactionStatus(id int64, status db.TxStatus) error

func (*GreenfieldDao) UpdateTransactionStatusAndClaimedTxHash

func (d *GreenfieldDao) UpdateTransactionStatusAndClaimedTxHash(id int64, status db.TxStatus, claimedTxHash string) error

type VoteDao

type VoteDao struct {
	DB *gorm.DB
}

func NewVoteDao

func NewVoteDao(db *gorm.DB) *VoteDao

func (*VoteDao) GetVoteByChannelIdAndSequenceAndPubKey

func (d *VoteDao) GetVoteByChannelIdAndSequenceAndPubKey(channelId uint8, sequence uint64, pubKey string) (*model.Vote, error)

func (*VoteDao) GetVotesByChannelIdAndSequence

func (d *VoteDao) GetVotesByChannelIdAndSequence(channelId uint8, sequence uint64) ([]*model.Vote, error)

func (*VoteDao) IsVoteExist

func (d *VoteDao) IsVoteExist(channelId uint8, sequence uint64, pubKey string) (bool, error)

func (*VoteDao) SaveBatchVotes

func (d *VoteDao) SaveBatchVotes(votes []*model.Vote) error

func (*VoteDao) SaveVote

func (d *VoteDao) SaveVote(vote *model.Vote) error

Jump to

Keyboard shortcuts

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