block

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: Apache-2.0, Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTransaction

func ApplyTransaction(author types.Address, header *types.Header, chain *repository.Repository, tx *types.Transaction, gp *common.GasPool) ([]byte, uint64, bool, error, types.Address)

ApplyMessage computes the new state by applying the given message against the old state within the environment. ApplyMessage returns the bytes returned by any EVM execution (if it took place), the gas used (which includes gas refunds) and an error if it failed. An error always indicates a core error meaning that the message would always fail for that particular state and would never be accepted within a block.

func GetTxsRoot

func GetTxsRoot(txs []*types.Transaction) types.Hash

Types

type BlockFilter

type BlockFilter struct {
	// contains filtered or unexported fields
}

TxFilter is an implemention of switch message filter, switch will use transaction filter to verify transaction message.

func NewBlockFilter

func NewBlockFilter(eventCenter types.EventCenter, verifySignature bool) *BlockFilter

create a new block filter instance.

func (*BlockFilter) Verify

func (filter *BlockFilter) Verify(portId int, msg interface{}) error

Verify verify a switch message whether is validated. return nil if message is validated, otherwise return relative error

type StateTransition

type StateTransition struct {
	// contains filtered or unexported fields
}

func NewStateTransition

func NewStateTransition(author types.Address, header *types.Header, chain *repository.Repository, trx *types.Transaction, gp *common.GasPool) *StateTransition

NewStateTransition initialises and returns a new state transition object.

func (*StateTransition) TransitionDb

func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bool, err error, address types.Address)

TransitionDb will transition the state by applying the current message and returning the result including the used gas. It returns an error if failed. An error indicates a consensus issue.

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(chain *repository.Repository, block *types.Block, signVerify bool) *Worker

func (*Worker) GetReceipts

func (self *Worker) GetReceipts() types.Receipts

func (*Worker) VerifyBlock

func (self *Worker) VerifyBlock() error

func (*Worker) VerifyTransaction

func (self *Worker) VerifyTransaction(author types.Address, gp *common.GasPool, header *types.Header,
	tx *types.Transaction, usedGas *uint64) (*types.Receipt, uint64, error)

func (*Worker) VerifyTrsSignature

func (self *Worker) VerifyTrsSignature(tx *types.Transaction) bool

Jump to

Keyboard shortcuts

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