Documentation ¶
Index ¶
- type Core
- func (m *Core) ApplyBlock(block *types.Block) error
- func (m *Core) BeforeProposalBlock(block *types.Block, gasLeft int64, isTimeout func() bool) ([]*types.Tx, error)
- func (m *Core) ChainStatus() (uint64, *bc.Hash, error)
- func (m *Core) DetachBlock(block *types.Block) error
- func (m *Core) InitChainStatus(startHash *bc.Hash) error
- func (m *Core) IsDust(tx *types.Tx) bool
- func (m *Core) Name() string
- func (m *Core) StartHeight() uint64
- func (m *Core) ValidateBlock(block *types.Block, verifyResults []*bc.TxVerifyResult) error
- func (m *Core) ValidateTx(tx *types.Tx, verifyResult *bc.TxVerifyResult, blockHeight uint64) error
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Core ¶ added in v1.1.0
type Core struct {
// contains filtered or unexported fields
}
Core represent the core logic of the match module, which include generate match transactions before packing the block, verify the match transaction in block is correct, and update the order table according to the transaction.
func NewCoreWithDB ¶ added in v1.1.0
func NewCoreWithDB(store *database.LevelDBMovStore, startBlockHeight uint64) *Core
NewCoreWithDB return a instance of Core by movStore
func (*Core) ApplyBlock ¶ added in v1.1.0
ApplyBlock parse pending order and cancel from the the transactions of block and add pending order to the dex db, remove cancel order from dex db.
func (*Core) BeforeProposalBlock ¶ added in v1.1.0
func (m *Core) BeforeProposalBlock(block *types.Block, gasLeft int64, isTimeout func() bool) ([]*types.Tx, error)
BeforeProposalBlock return all transactions than can be matched, and the number of transactions cannot exceed the given capacity.
func (*Core) ChainStatus ¶ added in v1.1.0
ChainStatus return the current block height and block hash in dex core
func (*Core) DetachBlock ¶ added in v1.1.0
DetachBlock parse pending order and cancel from the the transactions of block and add cancel order to the dex db, remove pending order from dex db.
func (*Core) InitChainStatus ¶ added in v1.1.1
InitChainStatus used to init the start block height and start block hash to store
func (*Core) IsDust ¶ added in v1.1.0
IsDust block the transaction that are not generated by the match engine
func (*Core) StartHeight ¶ added in v1.1.0
StartHeight return the start block height of current module
func (*Core) ValidateBlock ¶ added in v1.1.0
ValidateBlock no need to verify the block header, because the first module has been verified. just need to verify the transactions in the block.
func (*Core) ValidateTx ¶ added in v1.1.0
ValidateTx validate one transaction.