Documentation ¶
Index ¶
Constants ¶
View Source
const ( StatusProposing StatusPending StatusCommitted StatusVerifiedAndExecuted )
View Source
const (
BlockTableName = `block`
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { gorm.Model BlockSize uint16 // pubdata BlockCommitment string BlockHeight int64 `gorm:"uniqueIndex"` StateRoot string PriorityOperations int64 PendingOnChainOperationsHash string PendingOnChainOperationsPubData string CommittedTxHash string CommittedAt int64 VerifiedTxHash string VerifiedAt int64 Txs []*tx.Tx `gorm:"foreignKey:BlockId"` BlockStatus int64 }
func (*Block) ClearTxsModel ¶
func (b *Block) ClearTxsModel()
type BlockModel ¶
type BlockModel interface { CreateBlockTable() error DropBlockTable() error GetBlocks(limit int64, offset int64) (blocks []*Block, err error) GetBlocksBetween(start int64, end int64) (blocks []*Block, err error) GetBlockByHeight(blockHeight int64) (block *Block, err error) GetBlockByHeightWithoutTx(blockHeight int64) (block *Block, err error) GetCommittedBlocksCount() (count int64, err error) GetVerifiedBlocksCount() (count int64, err error) GetLatestVerifiedHeight() (height int64, err error) GetBlockByCommitment(blockCommitment string) (block *Block, err error) GetCommittedBlocksBetween(start, end int64) (blocks []*Block, err error) GetBlocksTotalCount() (count int64, err error) CreateGenesisBlock(block *Block) error GetCurrentBlockHeight() (blockHeight int64, err error) CreateBlockInTransact(tx *gorm.DB, oBlock *Block) error UpdateBlocksWithoutTxsInTransact(tx *gorm.DB, blocks []*Block) (err error) UpdateBlockInTransact(tx *gorm.DB, block *Block) (err error) }
func NewBlockModel ¶
func NewBlockModel(db *gorm.DB) BlockModel
type BlockStates ¶
type BlockStates struct { Block *Block CompressedBlock *compressedblock.CompressedBlock PendingAccount []*account.Account PendingAccountHistory []*account.AccountHistory PendingNft []*nft.L2Nft PendingNftHistory []*nft.L2NftHistory }
Click to show internal directories.
Click to hide internal directories.