evm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBlockGasLimit = 15000000
View Source
const DefaultGasPrice = 210000000
View Source
const PayloadTypeEVMCall = "evm"

Variables

View Source
var DefaultEvmTxSystemIdentifier = []byte{0, 0, 0, 3}

Functions

func Execute

func Execute(currentBlockNumber uint64, stateDB *statedb.StateDB, blockDB keyvaluedb.KeyValueDB, attr *TxAttributes, systemIdentifier []byte, gp *core.GasPool, gasUnitPrice *big.Int, fake bool) (*types.ServerMetadata, error)

Types

type FeeAccount

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

func (FeeAccount) GenericTransactionValidator

func (m FeeAccount) GenericTransactionValidator() txsystem.GenericTransactionValidator

func (FeeAccount) TxExecutors

func (m FeeAccount) TxExecutors() map[string]txsystem.TxExecutor

type FeeCalculator

type FeeCalculator func() uint64

func FixedFee

func FixedFee(fee uint64) FeeCalculator

type Module

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

func NewEVMModule

func NewEVMModule(systemIdentifier []byte, opts *Options) (*Module, error)

func (*Module) GenericTransactionValidator

func (m *Module) GenericTransactionValidator() txsystem.GenericTransactionValidator

func (*Module) StartBlockFunc

func (m *Module) StartBlockFunc(blockGasLimit uint64) []func(blockNr uint64) error

func (*Module) TxExecutors

func (m *Module) TxExecutors() map[string]txsystem.TxExecutor

type Option

type Option func(*Options)

func WithBlockDB

func WithBlockDB(blockDB keyvaluedb.KeyValueDB) Option

func WithBlockGasLimit

func WithBlockGasLimit(limit uint64) Option

func WithGasPrice

func WithGasPrice(gasPrice uint64) Option

func WithHashAlgorithm

func WithHashAlgorithm(algorithm gocrypto.Hash) Option

func WithInitialAddressAndBalance

func WithInitialAddressAndBalance(address []byte, balance *big.Int) Option

func WithMoneyTXSystemIdentifier

func WithMoneyTXSystemIdentifier(moneyTxSystemID []byte) Option

func WithState

func WithState(s *state.State) Option

func WithTrustBase

func WithTrustBase(tb map[string]crypto.Verifier) Option

type Options

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

func DefaultOptions

func DefaultOptions() *Options

type ProcessingDetails

type ProcessingDetails struct {
	ErrorDetails string
	ReturnData   []byte
	ContractAddr common.Address
	Logs         []*statedb.LogEntry
	// contains filtered or unexported fields
}

func (*ProcessingDetails) Bytes

func (d *ProcessingDetails) Bytes() ([]byte, error)

type StateTransition

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

type TxAttributes

type TxAttributes struct {
	From  []byte
	To    []byte
	Data  []byte
	Value *big.Int
	Gas   uint64
	Nonce uint64
	// contains filtered or unexported fields
}

func (*TxAttributes) AsMessage

func (t *TxAttributes) AsMessage(gasPrice *big.Int, fake bool) *core.Message

AsMessage returns the Alphabill transaction as a ethereum core.Message.

func (*TxAttributes) FromAddr

func (t *TxAttributes) FromAddr() common.Address

FromAddr - returns From as Address, if nil empty address is returned From is mandatory field and must not be nil in a valid TxAttributes

func (*TxAttributes) ToAddr

func (t *TxAttributes) ToAddr() *common.Address

ToAddr - returns To as Address pointer. To field is optional and not present on contract creation calls. If To is nil then nil pointer is returned

type TxSystem

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

func NewEVMTxSystem

func NewEVMTxSystem(systemIdentifier []byte, opts ...Option) (*TxSystem, error)

func (*TxSystem) BeginBlock

func (m *TxSystem) BeginBlock(blockNr uint64) error

func (*TxSystem) Commit

func (m *TxSystem) Commit() error

func (*TxSystem) CurrentBlockNumber

func (m *TxSystem) CurrentBlockNumber() uint64

func (*TxSystem) EndBlock

func (m *TxSystem) EndBlock() (txsystem.State, error)

func (*TxSystem) Execute

func (m *TxSystem) Execute(tx *types.TransactionOrder) (sm *types.ServerMetadata, err error)

func (*TxSystem) GetState

func (m *TxSystem) GetState() *state.State

func (*TxSystem) Revert

func (m *TxSystem) Revert()

func (*TxSystem) StateSummary

func (m *TxSystem) StateSummary() (txsystem.State, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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