Documentation
¶
Index ¶
- func ApplyTransaction(evm *evmNg.EVM, tx *types.Transaction, gp *common.GasPool) ([]byte, uint64, bool, error)
- func GetTxsRoot(txs []*types.Transaction) types.Hash
- func HeaderHash(h *types.Header) (hash types.Hash)
- func Sum(bz []byte) []byte
- func TxHash(tx *types.Transaction) (hash types.Hash)
- type BlockFilter
- type RefAddress
- type StateTransition
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTransaction ¶
func ApplyTransaction(evm *evmNg.EVM, tx *types.Transaction, gp *common.GasPool) ([]byte, uint64, bool, error)
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) *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 RefAddress ¶
func NewRefAddress ¶
func NewRefAddress(addr types.Address) *RefAddress
func (*RefAddress) Address ¶
func (self *RefAddress) Address() types.Address
type StateTransition ¶
type StateTransition struct {
// contains filtered or unexported fields
}
func NewStateTransition ¶
func NewStateTransition(evm *evmNg.EVM, 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)
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 *blockchain.BlockChain, block *types.Block) *Worker
func (*Worker) GetReceipts ¶
func (*Worker) VerifyBlock ¶
func (*Worker) VerifyTransaction ¶
func (*Worker) VerifyTrsSignature ¶
func (self *Worker) VerifyTrsSignature(tx *types.Transaction) bool