Documentation ¶
Index ¶
- Constants
- Variables
- type ExecuteTransactionContext
- func (context *ExecuteTransactionContext) Data() []byte
- func (context *ExecuteTransactionContext) From() *crypto.CommonAddress
- func (context *ExecuteTransactionContext) GasPrice() *big.Int
- func (context *ExecuteTransactionContext) GasRemained() uint64
- func (context *ExecuteTransactionContext) GasUsed() uint64
- func (context *ExecuteTransactionContext) Gp() *utils.GasPool
- func (context *ExecuteTransactionContext) Header() *types.BlockHeader
- func (context *ExecuteTransactionContext) InitialGas() uint64
- func (context *ExecuteTransactionContext) PreCheck() error
- func (context *ExecuteTransactionContext) RefundCoin() error
- func (context *ExecuteTransactionContext) RefundGas(refundGas uint64)
- func (context *ExecuteTransactionContext) To() crypto.CommonAddress
- func (context *ExecuteTransactionContext) TrieStore() store.StoreInterface
- func (context *ExecuteTransactionContext) Tx() *types.Transaction
- func (context *ExecuteTransactionContext) UseGas(amount uint64) error
- func (context *ExecuteTransactionContext) Value() *big.Int
- type ITransactionSelector
- type ITransactionValidator
- type Processor
Constants ¶
View Source
const (
MODULENAME = "transactions"
)
Variables ¶
View Source
var ( ErrNonceTooHigh = errors.New("nonce too high") ErrNonceTooLow = errors.New("nonce too low") ErrBalance = errors.New("not enough balance") ErrInsufficientBalanceForGas = errors.New("insufficient balance to pay for gasRemained") ErrOutOfGas = errors.New("out gas of block") ErrTxUnSupport = errors.New("unsupported transaction type") )
Functions ¶
This section is empty.
Types ¶
type ExecuteTransactionContext ¶
type ExecuteTransactionContext struct {
// contains filtered or unexported fields
}
func NewExecuteTransactionContext ¶
func NewExecuteTransactionContext(blockContext *block.BlockExecuteContext, chainstore store.StoreInterface, gasPool *utils.GasPool, from *crypto.CommonAddress, tx *types.Transaction) *ExecuteTransactionContext
func (*ExecuteTransactionContext) Data ¶
func (context *ExecuteTransactionContext) Data() []byte
func (*ExecuteTransactionContext) From ¶
func (context *ExecuteTransactionContext) From() *crypto.CommonAddress
func (*ExecuteTransactionContext) GasPrice ¶
func (context *ExecuteTransactionContext) GasPrice() *big.Int
func (*ExecuteTransactionContext) GasRemained ¶
func (context *ExecuteTransactionContext) GasRemained() uint64
func (*ExecuteTransactionContext) GasUsed ¶
func (context *ExecuteTransactionContext) GasUsed() uint64
gasRemained returns the amount of gasRemained used up by the state transition.
func (*ExecuteTransactionContext) Gp ¶
func (context *ExecuteTransactionContext) Gp() *utils.GasPool
func (*ExecuteTransactionContext) Header ¶
func (context *ExecuteTransactionContext) Header() *types.BlockHeader
func (*ExecuteTransactionContext) InitialGas ¶
func (context *ExecuteTransactionContext) InitialGas() uint64
func (*ExecuteTransactionContext) PreCheck ¶
func (context *ExecuteTransactionContext) PreCheck() error
func (*ExecuteTransactionContext) RefundCoin ¶
func (context *ExecuteTransactionContext) RefundCoin() error
func (*ExecuteTransactionContext) RefundGas ¶
func (context *ExecuteTransactionContext) RefundGas(refundGas uint64)
func (*ExecuteTransactionContext) To ¶
func (context *ExecuteTransactionContext) To() crypto.CommonAddress
func (*ExecuteTransactionContext) TrieStore ¶
func (context *ExecuteTransactionContext) TrieStore() store.StoreInterface
func (*ExecuteTransactionContext) Tx ¶
func (context *ExecuteTransactionContext) Tx() *types.Transaction
func (*ExecuteTransactionContext) UseGas ¶
func (context *ExecuteTransactionContext) UseGas(amount uint64) error
func (*ExecuteTransactionContext) Value ¶
func (context *ExecuteTransactionContext) Value() *big.Int
type ITransactionSelector ¶
type ITransactionSelector interface {
Select(tx *types.Transaction) bool
}
type ITransactionValidator ¶
type ITransactionValidator interface {
ExecuteTransaction(context *ExecuteTransactionContext) *types.ExecuteTransactionResult
}
type Processor ¶
type Processor struct { }
func (*Processor) ExecuteTransaction ¶
func (processor *Processor) ExecuteTransaction(context *ExecuteTransactionContext) *types.ExecuteTransactionResult
Click to show internal directories.
Click to hide internal directories.