Versions in this module Expand all Collapse all v0 v0.34.4 Jul 23, 2021 Changes in this version + const GasBaseOp + const GasCreateAccount + const GasEcRecover + const GasExpModBase + const GasExpModWord + const GasGetAccount + const GasIdentityBase + const GasIdentityWord + const GasRipemd160Base + const GasRipemd160Word + const GasSha256Base + const GasSha256Word + const GasSha3 + const GasStackOp + const GasStorageUpdate + func AddressFromName(name string) (address crypto.Address) + func Call(state State, params CallParams, ...) ([]byte, error) + func CallFromSite(st State, dispatcher Dispatcher, site CallParams, target CallParams) ([]byte, error) + func Connect(eds ...ExternalDispatcher) + func CreateAccount(st acmstate.ReaderWriter, address crypto.Address) error + func EnsurePermission(callFrame *CallFrame, address crypto.Address, perm permission.PermFlag) error + func FireCallEvent(callFrame *CallFrame, callErr error, eventSink exec.EventSink, output []byte, ...) error + func GetAccount(st acmstate.Reader, m Maybe, address crypto.Address) *acm.Account + func HasPermission(st acmstate.Reader, address crypto.Address, perm permission.PermFlag) (bool, error) + func InitChildCode(st acmstate.ReaderWriter, address crypto.Address, parent crypto.Address, ...) error + func InitEVMCode(st acmstate.ReaderWriter, address crypto.Address, code []byte) error + func InitWASMCode(st acmstate.ReaderWriter, address crypto.Address, code []byte) error + func MustAccount(st acmstate.Reader, address crypto.Address) (*acm.Account, error) + func MustGetAccount(st acmstate.Reader, m Maybe, address crypto.Address) *acm.Account + func RemoveAccount(st acmstate.ReaderWriter, address crypto.Address) error + func Transfer(st acmstate.ReaderWriter, from, to crypto.Address, amount *big.Int) error + func UpdateAccount(st acmstate.ReaderWriter, address crypto.Address, ...) error + func UpdateContractMeta(st acmstate.ReaderWriter, metaSt acmstate.MetadataWriter, ...) error + func UseGasNegative(gasLeft *big.Int, gasToUse uint64) errors.CodedError + type Blockchain interface + BlockHash func(height uint64) ([]byte, error) + ChainID func() string + LastBlockHeight func() uint64 + LastBlockTime func() time.Time + type CallFrame struct + func NewCallFrame(st acmstate.ReaderWriter, cacheOptions ...acmstate.CacheOption) *CallFrame + func (st *CallFrame) CallStackDepth() uint64 + func (st *CallFrame) CreateAccount(creator, address crypto.Address) error + func (st *CallFrame) NewFrame(cacheOptions ...acmstate.CacheOption) (*CallFrame, error) + func (st *CallFrame) ReadOnly() *CallFrame + func (st *CallFrame) Sync() error + func (st *CallFrame) WithMaxCallStackDepth(max uint64) *CallFrame + type CallParams struct + CallType exec.CallType + Callee crypto.Address + Caller crypto.Address + Gas *big.Int + Input []byte + Origin crypto.Address + Value big.Int + type Callable interface + Call func(state State, params CallParams) (output []byte, err error) + type CallableFunc func(st State, params CallParams) (output []byte, err error) + func (c CallableFunc) Call(state State, params CallParams) (output []byte, err error) + type Dispatcher interface + Dispatch func(acc *acm.Account) Callable + type DispatcherFunc func(acc *acm.Account) Callable + func (d DispatcherFunc) Dispatch(acc *acm.Account) Callable + type Dispatchers []Dispatcher + func NewDispatchers(dispatchers ...Dispatcher) Dispatchers + func (ds Dispatchers) Dispatch(acc *acm.Account) Callable + type ExternalDispatcher interface + SetExternals func(externals Dispatcher) + type Externals struct + func (ed *Externals) Dispatch(acc *acm.Account) Callable + func (ed *Externals) SetExternals(externals Dispatcher) + type ExternalsStorage struct + type Maybe interface + Error func() error + PushError func(err error) bool + type Memory interface + Capacity func() *big.Int + Read func(offset, length *big.Int) []byte + Write func(offset *big.Int, value []byte) + func DefaultDynamicMemoryProvider(errSink errors.Sink) Memory + func NewDynamicMemory(initialCapacity, maximumCapacity uint64, errSink errors.Sink) Memory + type Native interface + Address func() crypto.Address + ContractMeta func() []*acm.ContractMeta + FullName func() string + SetExternals func(externals Dispatcher) + type Natives interface + GetByAddress func(address crypto.Address) Native + type Options struct + CallStackMaxDepth uint64 + DataStackInitialCapacity uint64 + DataStackMaxDepth uint64 + DebugOpcodes bool + DumpTokens bool + Logger *logging.Logger + MemoryProvider func(errors.Sink) Memory + Natives Natives + Nonce []byte + type State struct + type TestBlockchain struct + BlockHeight uint64 + BlockTime time.Time + func (V *TestBlockchain) ChainID() string + func (b *TestBlockchain) BlockHash(height uint64) ([]byte, error) + func (b *TestBlockchain) LastBlockHeight() uint64 + func (b *TestBlockchain) LastBlockTime() time.Time