transactions

package
v0.0.0-...-a173fca Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

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 (*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 (*ExecuteTransactionContext) TrieStore

func (context *ExecuteTransactionContext) TrieStore() store.StoreInterface

func (*ExecuteTransactionContext) Tx

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

Jump to

Keyboard shortcuts

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