mock

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccountDoesntExist = errors.New("account does not exist")
View Source
var ErrCantDetermineAccountExists = errors.New("can't determine whether account exists")

Functions

This section is empty.

Types

type Account

type Account struct {
	Exists       bool
	Address      []byte
	Nonce        uint64
	Balance      *big.Int
	BalanceDelta *big.Int
	Storage      map[string][]byte
	Code         []byte
	Err          error
}

Account holds the account info

type AccountsMap

type AccountsMap map[string]*Account

AccountMap is a map from address to account

type BlockchainHookMock

type BlockchainHookMock struct {
	Accounts      AccountsMap
	BlockHash     []byte
	LNonce        uint64
	LRound        uint64
	CNonce        uint64
	CRound        uint64
	LTimeStamp    uint64
	CTimeStamp    uint64
	LRandomSeed   []byte
	CRandomSeed   []byte
	LEpoch        uint32
	CEpoch        uint32
	StateRootHash []byte
	NewAddr       []byte
	Err           error
}

func NewBlockchainHookMock

func NewBlockchainHookMock() *BlockchainHookMock

func (*BlockchainHookMock) AccountExists

func (b *BlockchainHookMock) AccountExists(address []byte) (bool, error)

func (*BlockchainHookMock) AddAccount

func (b *BlockchainHookMock) AddAccount(account *Account)

func (*BlockchainHookMock) AddAccounts

func (b *BlockchainHookMock) AddAccounts(accounts []*Account)

func (*BlockchainHookMock) CurrentEpoch

func (b *BlockchainHookMock) CurrentEpoch() uint32

func (*BlockchainHookMock) CurrentNonce

func (b *BlockchainHookMock) CurrentNonce() uint64

func (*BlockchainHookMock) CurrentRandomSeed

func (b *BlockchainHookMock) CurrentRandomSeed() []byte

func (*BlockchainHookMock) CurrentRound

func (b *BlockchainHookMock) CurrentRound() uint64

func (*BlockchainHookMock) CurrentTimeStamp

func (b *BlockchainHookMock) CurrentTimeStamp() uint64

func (*BlockchainHookMock) GetBalance

func (b *BlockchainHookMock) GetBalance(address []byte) (*big.Int, error)

func (*BlockchainHookMock) GetBlockhash

func (b *BlockchainHookMock) GetBlockhash(nonce uint64) ([]byte, error)

func (*BlockchainHookMock) GetCode

func (b *BlockchainHookMock) GetCode(address []byte) ([]byte, error)

func (*BlockchainHookMock) GetNonce

func (b *BlockchainHookMock) GetNonce(address []byte) (uint64, error)

func (*BlockchainHookMock) GetStateRootHash

func (b *BlockchainHookMock) GetStateRootHash() []byte

func (*BlockchainHookMock) GetStorageData

func (b *BlockchainHookMock) GetStorageData(address []byte, index []byte) ([]byte, error)

func (*BlockchainHookMock) IsCodeEmpty

func (b *BlockchainHookMock) IsCodeEmpty(address []byte) (bool, error)

func (*BlockchainHookMock) LastEpoch

func (b *BlockchainHookMock) LastEpoch() uint32

func (*BlockchainHookMock) LastNonce

func (b *BlockchainHookMock) LastNonce() uint64

func (*BlockchainHookMock) LastRandomSeed

func (b *BlockchainHookMock) LastRandomSeed() []byte

func (*BlockchainHookMock) LastRound

func (b *BlockchainHookMock) LastRound() uint64

func (*BlockchainHookMock) LastTimeStamp

func (b *BlockchainHookMock) LastTimeStamp() uint64

func (*BlockchainHookMock) NewAddress

func (b *BlockchainHookMock) NewAddress(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)

type BlockchainHookStub added in v0.3.8

type BlockchainHookStub struct {
	AccountExtistsCalled    func(address []byte) (bool, error)
	NewAddressCalled        func(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)
	GetBalanceCalled        func(address []byte) (*big.Int, error)
	GetNonceCalled          func(address []byte) (uint64, error)
	GetStorageDataCalled    func(accountsAddress []byte, index []byte) ([]byte, error)
	IsCodeEmptyCalled       func(address []byte) (bool, error)
	GetCodeCalled           func(address []byte) ([]byte, error)
	GetBlockHashCalled      func(nonce uint64) ([]byte, error)
	LastNonceCalled         func() uint64
	LastRoundCalled         func() uint64
	LastTimeStampCalled     func() uint64
	LastRandomSeedCalled    func() []byte
	LastEpochCalled         func() uint32
	GetStateRootHashCalled  func() []byte
	CurrentNonceCalled      func() uint64
	CurrentRoundCalled      func() uint64
	CurrentTimeStampCalled  func() uint64
	CurrentRandomSeedCalled func() []byte
	CurrentEpochCalled      func() uint32
}

func (*BlockchainHookStub) AccountExists added in v0.3.8

func (b *BlockchainHookStub) AccountExists(address []byte) (bool, error)

func (*BlockchainHookStub) CurrentEpoch added in v0.3.8

func (b *BlockchainHookStub) CurrentEpoch() uint32

func (*BlockchainHookStub) CurrentNonce added in v0.3.8

func (b *BlockchainHookStub) CurrentNonce() uint64

func (*BlockchainHookStub) CurrentRandomSeed added in v0.3.8

func (b *BlockchainHookStub) CurrentRandomSeed() []byte

func (*BlockchainHookStub) CurrentRound added in v0.3.8

func (b *BlockchainHookStub) CurrentRound() uint64

func (*BlockchainHookStub) CurrentTimeStamp added in v0.3.8

func (b *BlockchainHookStub) CurrentTimeStamp() uint64

func (*BlockchainHookStub) GetBalance added in v0.3.8

func (b *BlockchainHookStub) GetBalance(address []byte) (*big.Int, error)

func (*BlockchainHookStub) GetBlockhash added in v0.3.8

func (b *BlockchainHookStub) GetBlockhash(nonce uint64) ([]byte, error)

func (*BlockchainHookStub) GetCode added in v0.3.8

func (b *BlockchainHookStub) GetCode(address []byte) ([]byte, error)

func (*BlockchainHookStub) GetNonce added in v0.3.8

func (b *BlockchainHookStub) GetNonce(address []byte) (uint64, error)

func (*BlockchainHookStub) GetStateRootHash added in v0.3.8

func (b *BlockchainHookStub) GetStateRootHash() []byte

func (*BlockchainHookStub) GetStorageData added in v0.3.8

func (b *BlockchainHookStub) GetStorageData(accountAddress []byte, index []byte) ([]byte, error)

func (*BlockchainHookStub) IsCodeEmpty added in v0.3.8

func (b *BlockchainHookStub) IsCodeEmpty(address []byte) (bool, error)

func (*BlockchainHookStub) LastEpoch added in v0.3.8

func (b *BlockchainHookStub) LastEpoch() uint32

func (*BlockchainHookStub) LastNonce added in v0.3.8

func (b *BlockchainHookStub) LastNonce() uint64

func (*BlockchainHookStub) LastRandomSeed added in v0.3.8

func (b *BlockchainHookStub) LastRandomSeed() []byte

func (*BlockchainHookStub) LastRound added in v0.3.8

func (b *BlockchainHookStub) LastRound() uint64

func (*BlockchainHookStub) LastTimeStamp added in v0.3.8

func (b *BlockchainHookStub) LastTimeStamp() uint64

func (*BlockchainHookStub) NewAddress added in v0.3.8

func (b *BlockchainHookStub) NewAddress(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)

type CryptoHookMock

type CryptoHookMock struct {
	Result []byte
	Err    error
}

func (*CryptoHookMock) Ecrecover

func (c *CryptoHookMock) Ecrecover(hash []byte, recoveryID []byte, r []byte, s []byte) ([]byte, error)

func (*CryptoHookMock) Keccak256

func (c *CryptoHookMock) Keccak256(data []byte) ([]byte, error)

func (*CryptoHookMock) Ripemd160

func (c *CryptoHookMock) Ripemd160(data []byte) ([]byte, error)

func (*CryptoHookMock) Sha256

func (c *CryptoHookMock) Sha256(data []byte) ([]byte, error)

type MeteringContextMock

type MeteringContextMock struct {
	GasCost           *config.GasCost
	GasLeftMock       uint64
	BlockGasLimitMock uint64
	Err               error
}

func (*MeteringContextMock) BlockGasLimit

func (m *MeteringContextMock) BlockGasLimit() uint64

func (*MeteringContextMock) BoundGasLimit

func (m *MeteringContextMock) BoundGasLimit(value int64) uint64

func (*MeteringContextMock) DeductInitialGasForDirectDeployment

func (m *MeteringContextMock) DeductInitialGasForDirectDeployment(input *vmcommon.ContractCreateInput) error

func (*MeteringContextMock) DeductInitialGasForExecution

func (m *MeteringContextMock) DeductInitialGasForExecution(contract []byte) error

func (*MeteringContextMock) DeductInitialGasForIndirectDeployment

func (m *MeteringContextMock) DeductInitialGasForIndirectDeployment(input *vmcommon.ContractCreateInput) error

func (*MeteringContextMock) FreeGas

func (m *MeteringContextMock) FreeGas(gas uint64)

func (*MeteringContextMock) GasLeft

func (m *MeteringContextMock) GasLeft() uint64

func (*MeteringContextMock) GasSchedule

func (m *MeteringContextMock) GasSchedule() *config.GasCost

func (*MeteringContextMock) RestoreGas

func (m *MeteringContextMock) RestoreGas(gas uint64)

func (*MeteringContextMock) SetGasSchedule

func (m *MeteringContextMock) SetGasSchedule(gasSchedule map[string]map[string]uint64)

func (*MeteringContextMock) UnlockGasIfAsyncStep

func (m *MeteringContextMock) UnlockGasIfAsyncStep()

func (*MeteringContextMock) UseGas

func (m *MeteringContextMock) UseGas(gas uint64)

type OutputContextMock

type OutputContextMock struct {
	OutputStateMock    *vmcommon.VMOutput
	ReturnDataMock     [][]byte
	ReturnCodeMock     vmcommon.ReturnCode
	ReturnMessageMock  string
	GasRemaining       uint64
	GasRefund          *big.Int
	OutputAccounts     map[string]*vmcommon.OutputAccount
	DeletedAccounts    [][]byte
	TouchedAccounts    [][]byte
	Logs               []*vmcommon.LogEntry
	OutputAccountMock  *vmcommon.OutputAccount
	OutputAccountIsNew bool
	Err                error
	TransferResult     error
}

func (*OutputContextMock) AddTxValueToAccount

func (o *OutputContextMock) AddTxValueToAccount(address []byte, value *big.Int)

func (*OutputContextMock) ClearReturnData

func (o *OutputContextMock) ClearReturnData()

func (*OutputContextMock) ClearStateStack

func (o *OutputContextMock) ClearStateStack()

func (*OutputContextMock) CreateVMOutputInCaseOfError

func (o *OutputContextMock) CreateVMOutputInCaseOfError(errCode vmcommon.ReturnCode, message string) *vmcommon.VMOutput

func (*OutputContextMock) DeployCode

func (o *OutputContextMock) DeployCode(address []byte, code []byte)

func (*OutputContextMock) Finish

func (o *OutputContextMock) Finish(data []byte)

func (*OutputContextMock) GetOutputAccount

func (o *OutputContextMock) GetOutputAccount(address []byte) (*vmcommon.OutputAccount, bool)

func (*OutputContextMock) GetRefund

func (o *OutputContextMock) GetRefund() uint64

func (*OutputContextMock) GetVMOutput

func (o *OutputContextMock) GetVMOutput() *vmcommon.VMOutput

func (*OutputContextMock) InitState

func (o *OutputContextMock) InitState()

func (*OutputContextMock) NewVMOutputAccount

func (o *OutputContextMock) NewVMOutputAccount(address []byte) *vmcommon.OutputAccount

func (*OutputContextMock) NewVMOutputAccountFromMockAccount

func (o *OutputContextMock) NewVMOutputAccountFromMockAccount(account *Account) *vmcommon.OutputAccount

func (*OutputContextMock) PopState

func (o *OutputContextMock) PopState()

func (*OutputContextMock) PushState

func (o *OutputContextMock) PushState()

func (*OutputContextMock) ReturnCode

func (o *OutputContextMock) ReturnCode() vmcommon.ReturnCode

func (*OutputContextMock) ReturnData

func (o *OutputContextMock) ReturnData() [][]byte

func (*OutputContextMock) ReturnMessage

func (o *OutputContextMock) ReturnMessage() string

func (*OutputContextMock) SelfDestruct

func (o *OutputContextMock) SelfDestruct(_ []byte, _ []byte)

func (*OutputContextMock) SetRefund

func (o *OutputContextMock) SetRefund(refund uint64)

func (*OutputContextMock) SetReturnCode

func (o *OutputContextMock) SetReturnCode(returnCode vmcommon.ReturnCode)

func (*OutputContextMock) SetReturnMessage

func (o *OutputContextMock) SetReturnMessage(returnMessage string)

func (*OutputContextMock) Transfer

func (o *OutputContextMock) Transfer(destination []byte, sender []byte, gasLimit uint64, value *big.Int, input []byte) error

func (*OutputContextMock) WriteLog

func (o *OutputContextMock) WriteLog(address []byte, topics [][]byte, data []byte)

type OutputContextStub

type OutputContextStub struct {
	InitStateCalled                   func()
	PushStateCalled                   func()
	PopStateCalled                    func()
	ClearStateStackCalled             func()
	GetOutputAccountCalled            func(address []byte) (*vmcommon.OutputAccount, bool)
	WriteLogCalled                    func(address []byte, topics [][]byte, data []byte)
	TransferCalled                    func(destination []byte, sender []byte, gasLimit uint64, value *big.Int, input []byte) error
	SelfDestructCalled                func(address []byte, beneficiary []byte)
	GetRefundCalled                   func() uint64
	SetRefundCalled                   func(refund uint64)
	ReturnCodeCalled                  func() vmcommon.ReturnCode
	SetReturnCodeCalled               func(returnCode vmcommon.ReturnCode)
	ReturnMessageCalled               func() string
	SetReturnMessageCalled            func(message string)
	ReturnDataCalled                  func() [][]byte
	ClearReturnDataCalled             func()
	FinishCalled                      func(data []byte)
	GetVMOutputCalled                 func() *vmcommon.VMOutput
	AddTxValueToAccountCalled         func(address []byte, value *big.Int)
	DeployCodeCalled                  func(address []byte, code []byte)
	CreateVMOutputInCaseOfErrorCalled func(errCode vmcommon.ReturnCode, message string) *vmcommon.VMOutput
}

func (*OutputContextStub) AddTxValueToAccount

func (o *OutputContextStub) AddTxValueToAccount(address []byte, value *big.Int)

func (*OutputContextStub) ClearReturnData

func (o *OutputContextStub) ClearReturnData()

func (*OutputContextStub) ClearStateStack

func (o *OutputContextStub) ClearStateStack()

func (*OutputContextStub) CreateVMOutputInCaseOfError

func (o *OutputContextStub) CreateVMOutputInCaseOfError(errCode vmcommon.ReturnCode, message string) *vmcommon.VMOutput

func (*OutputContextStub) DeployCode

func (o *OutputContextStub) DeployCode(address []byte, code []byte)

func (*OutputContextStub) Finish

func (o *OutputContextStub) Finish(data []byte)

func (*OutputContextStub) GetOutputAccount

func (o *OutputContextStub) GetOutputAccount(address []byte) (*vmcommon.OutputAccount, bool)

func (*OutputContextStub) GetRefund

func (o *OutputContextStub) GetRefund() uint64

func (*OutputContextStub) GetVMOutput

func (o *OutputContextStub) GetVMOutput() *vmcommon.VMOutput

func (*OutputContextStub) InitState

func (o *OutputContextStub) InitState()

func (*OutputContextStub) PopState

func (o *OutputContextStub) PopState()

func (*OutputContextStub) PushState

func (o *OutputContextStub) PushState()

func (*OutputContextStub) ReturnCode

func (o *OutputContextStub) ReturnCode() vmcommon.ReturnCode

func (*OutputContextStub) ReturnData

func (o *OutputContextStub) ReturnData() [][]byte

func (*OutputContextStub) ReturnMessage

func (o *OutputContextStub) ReturnMessage() string

func (*OutputContextStub) SelfDestruct

func (o *OutputContextStub) SelfDestruct(address []byte, beneficiary []byte)

func (*OutputContextStub) SetRefund

func (o *OutputContextStub) SetRefund(refund uint64)

func (*OutputContextStub) SetReturnCode

func (o *OutputContextStub) SetReturnCode(returnCode vmcommon.ReturnCode)

func (*OutputContextStub) SetReturnMessage

func (o *OutputContextStub) SetReturnMessage(message string)

func (*OutputContextStub) Transfer

func (o *OutputContextStub) Transfer(destination []byte, sender []byte, gasLimit uint64, value *big.Int, input []byte) error

func (*OutputContextStub) WriteLog

func (o *OutputContextStub) WriteLog(address []byte, topics [][]byte, data []byte)

type RuntimeContextMock

type RuntimeContextMock struct {
	Err                    error
	VmInput                *vmcommon.VMInput
	SCAddress              []byte
	CallFunction           string
	VmType                 []byte
	ReadOnlyFlag           bool
	CurrentBreakpointValue arwen.BreakpointValue
	PointsUsed             uint64
	InstanceCtxId          int
	MemLoadResult          []byte
	ArgParserMock          arwen.ArgumentsParser
	FailCryptoAPI          bool
	FailElrondAPI          bool
	FailBigIntAPI          bool
	AsyncCallInfo          *arwen.AsyncCallInfo
}

func (*RuntimeContextMock) ArgParser

func (r *RuntimeContextMock) ArgParser() arwen.ArgumentsParser

func (*RuntimeContextMock) Arguments

func (r *RuntimeContextMock) Arguments() [][]byte

func (*RuntimeContextMock) BigIntAPIErrorShouldFailExecution

func (r *RuntimeContextMock) BigIntAPIErrorShouldFailExecution() bool

func (*RuntimeContextMock) CleanInstance

func (r *RuntimeContextMock) CleanInstance()

func (*RuntimeContextMock) ClearInstanceStack

func (r *RuntimeContextMock) ClearInstanceStack()

func (*RuntimeContextMock) ClearStateStack

func (r *RuntimeContextMock) ClearStateStack()

func (*RuntimeContextMock) CreateWasmerInstance

func (r *RuntimeContextMock) CreateWasmerInstance(contract []byte, gasLimit uint64) error

func (*RuntimeContextMock) CryptoAPIErrorShouldFailExecution

func (r *RuntimeContextMock) CryptoAPIErrorShouldFailExecution() bool

func (*RuntimeContextMock) ElrondAPIErrorShouldFailExecution

func (r *RuntimeContextMock) ElrondAPIErrorShouldFailExecution() bool

func (*RuntimeContextMock) FailExecution

func (r *RuntimeContextMock) FailExecution(err error)

func (*RuntimeContextMock) Function

func (r *RuntimeContextMock) Function() string

func (*RuntimeContextMock) GetAsyncCallInfo

func (r *RuntimeContextMock) GetAsyncCallInfo() *arwen.AsyncCallInfo

func (*RuntimeContextMock) GetFunctionToCall

func (r *RuntimeContextMock) GetFunctionToCall() (wasmer.ExportedFunctionCallback, error)

func (*RuntimeContextMock) GetInitFunction

func (r *RuntimeContextMock) GetInitFunction() wasmer.ExportedFunctionCallback

func (*RuntimeContextMock) GetInstanceContext

func (r *RuntimeContextMock) GetInstanceContext() *wasmer.InstanceContext

func (*RuntimeContextMock) GetInstanceExports

func (r *RuntimeContextMock) GetInstanceExports() wasmer.ExportsMap

func (*RuntimeContextMock) GetPointsUsed

func (r *RuntimeContextMock) GetPointsUsed() uint64

func (*RuntimeContextMock) GetRuntimeBreakpointValue

func (r *RuntimeContextMock) GetRuntimeBreakpointValue() arwen.BreakpointValue

func (*RuntimeContextMock) GetSCAddress

func (r *RuntimeContextMock) GetSCAddress() []byte

func (*RuntimeContextMock) GetVMInput

func (r *RuntimeContextMock) GetVMInput() *vmcommon.VMInput

func (*RuntimeContextMock) GetVMType

func (r *RuntimeContextMock) GetVMType() []byte

func (*RuntimeContextMock) InitState

func (r *RuntimeContextMock) InitState()

func (*RuntimeContextMock) InitStateFromContractCallInput

func (r *RuntimeContextMock) InitStateFromContractCallInput(input *vmcommon.ContractCallInput)

func (*RuntimeContextMock) MemLoad

func (r *RuntimeContextMock) MemLoad(offset int32, length int32) ([]byte, error)

func (*RuntimeContextMock) MemStore

func (r *RuntimeContextMock) MemStore(offset int32, data []byte) error

func (*RuntimeContextMock) PopInstance

func (r *RuntimeContextMock) PopInstance()

func (*RuntimeContextMock) PopState

func (r *RuntimeContextMock) PopState()

func (*RuntimeContextMock) PushInstance

func (r *RuntimeContextMock) PushInstance()

func (*RuntimeContextMock) PushState

func (r *RuntimeContextMock) PushState()

func (*RuntimeContextMock) ReadOnly

func (r *RuntimeContextMock) ReadOnly() bool

func (*RuntimeContextMock) SetAsyncCallInfo

func (r *RuntimeContextMock) SetAsyncCallInfo(asyncCallInfo *arwen.AsyncCallInfo)

func (*RuntimeContextMock) SetInstanceContext

func (r *RuntimeContextMock) SetInstanceContext(instCtx *wasmer.InstanceContext)

func (*RuntimeContextMock) SetInstanceContextId

func (r *RuntimeContextMock) SetInstanceContextId(id int)

func (*RuntimeContextMock) SetPointsUsed

func (r *RuntimeContextMock) SetPointsUsed(gasPoints uint64)

func (*RuntimeContextMock) SetReadOnly

func (r *RuntimeContextMock) SetReadOnly(readOnly bool)

func (*RuntimeContextMock) SetRuntimeBreakpointValue

func (r *RuntimeContextMock) SetRuntimeBreakpointValue(value arwen.BreakpointValue)

func (*RuntimeContextMock) SetSCAddress

func (r *RuntimeContextMock) SetSCAddress(scAddress []byte)

func (*RuntimeContextMock) SetVMInput

func (r *RuntimeContextMock) SetVMInput(vmInput *vmcommon.VMInput)

func (*RuntimeContextMock) SignalExit

func (r *RuntimeContextMock) SignalExit(_ int)

func (*RuntimeContextMock) SignalUserError

func (r *RuntimeContextMock) SignalUserError(_ string)

func (*RuntimeContextMock) VerifyContractCode

func (r *RuntimeContextMock) VerifyContractCode() error

type VmHostMock

type VmHostMock struct {
	BlockChainHook vmcommon.BlockchainHook
	CryptoHook     vmcommon.CryptoHook

	EthInput []byte

	BlockchainContext arwen.BlockchainContext
	RuntimeContext    arwen.RuntimeContext
	OutputContext     arwen.OutputContext
	MeteringContext   arwen.MeteringContext
	StorageContext    arwen.StorageContext
	BigIntContext     arwen.BigIntContext
}

func (*VmHostMock) BigInt

func (host *VmHostMock) BigInt() arwen.BigIntContext

func (*VmHostMock) Blockchain

func (host *VmHostMock) Blockchain() arwen.BlockchainContext

func (*VmHostMock) ClearStateStack

func (host *VmHostMock) ClearStateStack()

func (*VmHostMock) CreateNewContract

func (host *VmHostMock) CreateNewContract(input *vmcommon.ContractCreateInput) ([]byte, error)

func (*VmHostMock) Crypto

func (host *VmHostMock) Crypto() vmcommon.CryptoHook

func (*VmHostMock) EthereumCallData

func (host *VmHostMock) EthereumCallData() []byte

func (*VmHostMock) ExecuteOnDestContext

func (host *VmHostMock) ExecuteOnDestContext(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)

func (*VmHostMock) ExecuteOnSameContext

func (host *VmHostMock) ExecuteOnSameContext(input *vmcommon.ContractCallInput) error

func (*VmHostMock) InitState

func (host *VmHostMock) InitState()

func (*VmHostMock) Metering

func (host *VmHostMock) Metering() arwen.MeteringContext

func (*VmHostMock) Output

func (host *VmHostMock) Output() arwen.OutputContext

func (*VmHostMock) PopState

func (host *VmHostMock) PopState()

func (*VmHostMock) PushState

func (host *VmHostMock) PushState()

func (*VmHostMock) Runtime

func (host *VmHostMock) Runtime() arwen.RuntimeContext

func (*VmHostMock) Storage

func (host *VmHostMock) Storage() arwen.StorageContext

type VmHostStub

type VmHostStub struct {
	InitStateCalled       func()
	PushStateCalled       func()
	PopStateCalled        func()
	ClearStateStackCalled func()

	CryptoCalled               func() vmcommon.CryptoHook
	BlockchainCalled           func() arwen.BlockchainContext
	RuntimeCalled              func() arwen.RuntimeContext
	BigIntCalled               func() arwen.BigIntContext
	OutputCalled               func() arwen.OutputContext
	MeteringCalled             func() arwen.MeteringContext
	StorageCalled              func() arwen.StorageContext
	CreateNewContractCalled    func(input *vmcommon.ContractCreateInput) ([]byte, error)
	ExecuteOnSameContextCalled func(input *vmcommon.ContractCallInput) error
	ExecuteOnDestContextCalled func(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
	EthereumCallDataCalled     func() []byte
}

func (*VmHostStub) BigInt

func (vhs *VmHostStub) BigInt() arwen.BigIntContext

func (*VmHostStub) Blockchain

func (vhs *VmHostStub) Blockchain() arwen.BlockchainContext

func (*VmHostStub) ClearStateStack

func (vhs *VmHostStub) ClearStateStack()

func (*VmHostStub) CreateNewContract

func (vhs *VmHostStub) CreateNewContract(input *vmcommon.ContractCreateInput) ([]byte, error)

func (*VmHostStub) Crypto

func (vhs *VmHostStub) Crypto() vmcommon.CryptoHook

func (*VmHostStub) EthereumCallData

func (vhs *VmHostStub) EthereumCallData() []byte

func (*VmHostStub) ExecuteOnDestContext

func (vhs *VmHostStub) ExecuteOnDestContext(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)

func (*VmHostStub) ExecuteOnSameContext

func (vhs *VmHostStub) ExecuteOnSameContext(input *vmcommon.ContractCallInput) error

func (*VmHostStub) InitState

func (vhs *VmHostStub) InitState()

func (*VmHostStub) Metering

func (vhs *VmHostStub) Metering() arwen.MeteringContext

func (*VmHostStub) Output

func (vhs *VmHostStub) Output() arwen.OutputContext

func (*VmHostStub) PopState

func (vhs *VmHostStub) PopState()

func (*VmHostStub) PushState

func (vhs *VmHostStub) PushState()

func (*VmHostStub) Runtime

func (vhs *VmHostStub) Runtime() arwen.RuntimeContext

func (*VmHostStub) Storage

func (vhs *VmHostStub) Storage() arwen.StorageContext

Jump to

Keyboard shortcuts

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