l1rolluptx

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableName = "l1_rollup_tx"

	StatusPending = 1
	StatusHandled = 2

	TxTypeCommit           = 1
	TxTypeVerifyAndExecute = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type L1RollupTx

type L1RollupTx struct {
	gorm.Model
	// txVerification hash
	L1TxHash string
	// txVerification status, 1 - pending, 2 - handled
	TxStatus int
	// txVerification type: commit / verify
	TxType uint8
	// layer-2 block height
	L2BlockHeight int64
}

func (*L1RollupTx) TableName

func (*L1RollupTx) TableName() string

type L1RollupTxModel

type L1RollupTxModel interface {
	CreateL1RollupTxTable() error
	DropL1RollupTxTable() error
	CreateL1RollupTx(tx *L1RollupTx) error
	GetLatestHandledTx(txType int64) (tx *L1RollupTx, err error)
	GetLatestPendingTx(txType int64) (tx *L1RollupTx, err error)
	GetL1RollupTxsByStatus(txStatus int) (txs []*L1RollupTx, err error)
	GetL1RollupTxsByHash(hash string) (txs []*L1RollupTx, err error)
	DeleteL1RollupTx(tx *L1RollupTx) error
	UpdateL1RollupTxsInTransact(tx *gorm.DB, txs []*L1RollupTx) error
}

func NewL1RollupTxModel

func NewL1RollupTxModel(db *gorm.DB) L1RollupTxModel

Jump to

Keyboard shortcuts

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