Documentation ¶
Index ¶
- type BlockchainHookStub
- func (b *BlockchainHookStub) ClearCompiledCodes()
- func (b *BlockchainHookStub) CurrentEpoch() uint32
- func (b *BlockchainHookStub) CurrentNonce() uint64
- func (b *BlockchainHookStub) CurrentRandomSeed() []byte
- func (b *BlockchainHookStub) CurrentRound() uint64
- func (b *BlockchainHookStub) CurrentTimeStamp() uint64
- func (b *BlockchainHookStub) ExecuteSmartContractCallOnOtherVM(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
- func (b *BlockchainHookStub) GetAllState(address []byte) (map[string][]byte, error)
- func (b *BlockchainHookStub) GetBlockhash(nonce uint64) ([]byte, error)
- func (b *BlockchainHookStub) GetBuiltinFunctionNames() vmcommon.FunctionNames
- func (b *BlockchainHookStub) GetCode(account vmcommon.UserAccountHandler) []byte
- func (b *BlockchainHookStub) GetCompiledCode(codeHash []byte) (bool, []byte)
- func (b *BlockchainHookStub) GetESDTToken(address []byte, tokenID []byte, nonce uint64) (*esdt.ESDigitalToken, error)
- func (b *BlockchainHookStub) GetShardOfAddress(address []byte) uint32
- func (b *BlockchainHookStub) GetSnapshot() int
- func (b *BlockchainHookStub) GetStateRootHash() []byte
- func (b *BlockchainHookStub) GetStorageData(accountAddress []byte, index []byte) ([]byte, uint32, error)
- func (b *BlockchainHookStub) GetUserAccount(address []byte) (vmcommon.UserAccountHandler, error)
- func (b *BlockchainHookStub) IsInterfaceNil() bool
- func (b *BlockchainHookStub) IsLimitedTransfer(_ []byte) bool
- func (b *BlockchainHookStub) IsPaused(_ []byte) bool
- func (b *BlockchainHookStub) IsPayable(_, address []byte) (bool, error)
- func (b *BlockchainHookStub) IsSmartContract(address []byte) bool
- func (b *BlockchainHookStub) LastEpoch() uint32
- func (b *BlockchainHookStub) LastNonce() uint64
- func (b *BlockchainHookStub) LastRandomSeed() []byte
- func (b *BlockchainHookStub) LastRound() uint64
- func (b *BlockchainHookStub) LastTimeStamp() uint64
- func (b *BlockchainHookStub) NewAddress(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)
- func (b *BlockchainHookStub) ProcessBuiltInFunction(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
- func (b *BlockchainHookStub) RevertToSnapshot(snapshot int) error
- func (b *BlockchainHookStub) SaveCompiledCode(codeHash []byte, code []byte)
- type CryptoHookMock
- func (c *CryptoHookMock) Ecrecover(_ []byte, _ []byte, _ []byte, _ []byte) ([]byte, error)
- func (c *CryptoHookMock) EncodeSecp256k1DERSignature(_, _ []byte) []byte
- func (c *CryptoHookMock) Keccak256(_ []byte) ([]byte, error)
- func (c *CryptoHookMock) Ripemd160(_ []byte) ([]byte, error)
- func (c *CryptoHookMock) Sha256(_ []byte) ([]byte, error)
- func (c *CryptoHookMock) VerifyBLS(_ []byte, _ []byte, _ []byte) error
- func (c *CryptoHookMock) VerifyEd25519(_ []byte, _ []byte, _ []byte) error
- func (c *CryptoHookMock) VerifySecp256k1(_ []byte, _ []byte, _ []byte, _ uint8) error
- type ExecutorMock
- func (executorMock *ExecutorMock) CreateAndStoreInstanceMock(t testing.TB, host vmhost.VMHost, code []byte, codeHash []byte, ...) *InstanceMock
- func (executorMock *ExecutorMock) FunctionNames() vmcommon.FunctionNames
- func (executorMock *ExecutorMock) IsInterfaceNil() bool
- func (executorMock *ExecutorMock) NewInstanceFromCompiledCodeWithOptions(compiledCode []byte, options executor.CompilationOptions) (executor.Instance, error)
- func (executorMock *ExecutorMock) NewInstanceWithOptions(contractCode []byte, options executor.CompilationOptions) (executor.Instance, error)
- func (executorMock *ExecutorMock) SetOpcodeCosts(_ *executor.WASMOpcodeCost)
- type ExecutorMockFactory
- type InstanceMock
- func (instance *InstanceMock) AddMockMethod(name string, method mockMethod)
- func (instance *InstanceMock) AddMockMethodWithError(name string, method mockMethod, err error)
- func (instance *InstanceMock) Cache() ([]byte, error)
- func (instance *InstanceMock) CallFunction(funcName string) error
- func (instance *InstanceMock) Clean() bool
- func (instance *InstanceMock) GetBreakpointValue() uint64
- func (instance *InstanceMock) GetFunctionNames() []string
- func (instance *InstanceMock) GetPointsUsed() uint64
- func (instance *InstanceMock) GetVMHooksPtr() uintptr
- func (instance *InstanceMock) HasFunction(name string) bool
- func (instance *InstanceMock) HasMemory() bool
- func (instance *InstanceMock) ID() string
- func (instance *InstanceMock) IsAlreadyCleaned() bool
- func (instance *InstanceMock) IsFunctionImported(name string) bool
- func (instance *InstanceMock) IsInterfaceNil() bool
- func (instance *InstanceMock) MemDump() []byte
- func (instance *InstanceMock) MemGrow(pages uint32) error
- func (instance *InstanceMock) MemLength() uint32
- func (instance *InstanceMock) MemLoad(memPtr executor.MemPtr, length executor.MemLength) ([]byte, error)
- func (instance *InstanceMock) MemStore(memPtr executor.MemPtr, data []byte) error
- func (instance *InstanceMock) Reset() bool
- func (instance *InstanceMock) SetBreakpointValue(value uint64)
- func (instance *InstanceMock) SetGasLimit(gasLimit uint64)
- func (instance *InstanceMock) SetPointsUsed(points uint64)
- func (instance *InstanceMock) SetVMHooksPtr(_ uintptr)
- func (instance *InstanceMock) ValidateFunctionArities() error
- func (instance *InstanceMock) ValidateVoidFunction(_ string) error
- type MemoryMock
- type MeteringContextMock
- func (m *MeteringContextMock) BlockGasLimit() uint64
- func (m *MeteringContextMock) BoundGasLimit(value int64) uint64
- func (m *MeteringContextMock) ClearStateStack()
- func (m *MeteringContextMock) ComputeExtraGasLockedForAsync() uint64
- func (m *MeteringContextMock) DeductGasIfAsyncStep() error
- func (m *MeteringContextMock) DeductInitialGasForDirectDeployment(_ vmhost.CodeDeployInput) error
- func (m *MeteringContextMock) DeductInitialGasForExecution(_ []byte) error
- func (m *MeteringContextMock) DeductInitialGasForIndirectDeployment(_ vmhost.CodeDeployInput) error
- func (m *MeteringContextMock) DisableRestoreGas()
- func (m *MeteringContextMock) EnableRestoreGas()
- func (m *MeteringContextMock) FreeGas(gas uint64)
- func (m *MeteringContextMock) GasLeft() uint64
- func (m *MeteringContextMock) GasSchedule() *config.GasCost
- func (m *MeteringContextMock) GasSpentByContract() uint64
- func (m *MeteringContextMock) GasUsedByContract() (uint64, uint64)
- func (m *MeteringContextMock) GasUsedForExecution() uint64
- func (m *MeteringContextMock) GetGasForExecution() uint64
- func (m *MeteringContextMock) GetGasLocked() uint64
- func (m *MeteringContextMock) GetGasProvided() uint64
- func (m *MeteringContextMock) GetGasTrace() map[string]map[string][]uint64
- func (m *MeteringContextMock) GetSCPrepareInitialCost() uint64
- func (m *MeteringContextMock) InitState()
- func (m *MeteringContextMock) InitStateFromContractCallInput(_ *vmcommon.VMInput)
- func (m *MeteringContextMock) PopDiscard()
- func (m *MeteringContextMock) PopMergeActiveState()
- func (m *MeteringContextMock) PopSetActiveState()
- func (m *MeteringContextMock) PushState()
- func (m *MeteringContextMock) RestoreGas(gas uint64)
- func (m *MeteringContextMock) SetGasSchedule(gasSchedule config.GasScheduleMap)
- func (m *MeteringContextMock) SetGasTracing(_ bool)
- func (m *MeteringContextMock) StartGasTracing(_ string)
- func (m *MeteringContextMock) TrackGasUsedByOutOfVMFunction(_ *vmcommon.ContractCallInput, _ *vmcommon.VMOutput, ...)
- func (m *MeteringContextMock) UnlockGasIfAsyncCallback()
- func (m *MeteringContextMock) UnlockGasIfAsyncStep()
- func (m *MeteringContextMock) UpdateGasStateOnFailure(_ *vmcommon.VMOutput)
- func (m *MeteringContextMock) UpdateGasStateOnSuccess(_ *vmcommon.VMOutput) error
- func (m *MeteringContextMock) UseAndTraceGas(_ uint64)
- func (m *MeteringContextMock) UseGas(gas uint64)
- func (m *MeteringContextMock) UseGasAndAddTracedGas(_ string, _ uint64)
- func (m *MeteringContextMock) UseGasBounded(gas uint64) error
- func (m *MeteringContextMock) UseGasBoundedAndAddTracedGas(_ string, _ uint64) error
- func (m *MeteringContextMock) UseGasForAsyncStep() error
- type OutputContextMock
- func (o *OutputContextMock) AddToActiveState(_ *vmcommon.VMOutput)
- func (o *OutputContextMock) AddTxValueToAccount(_ []byte, _ *big.Int)
- func (o *OutputContextMock) CensorVMOutput()
- func (o *OutputContextMock) ClearReturnData()
- func (o *OutputContextMock) ClearStateStack()
- func (o *OutputContextMock) CopyTopOfStackToActiveState()
- func (o *OutputContextMock) CreateVMOutputInCaseOfError(_ error) *vmcommon.VMOutput
- func (o *OutputContextMock) DeleteFirstReturnData()
- func (o *OutputContextMock) DeleteOutputAccount(_ []byte)
- func (o *OutputContextMock) DeployCode(_ vmhost.CodeDeployInput)
- func (o *OutputContextMock) Finish(data []byte)
- func (o *OutputContextMock) GetCrtTransferIndex() uint32
- func (o *OutputContextMock) GetCurrentTotalUsedGas() (uint64, bool)
- func (o *OutputContextMock) GetOutputAccount(_ []byte) (*vmcommon.OutputAccount, bool)
- func (o *OutputContextMock) GetOutputAccounts() map[string]*vmcommon.OutputAccount
- func (o *OutputContextMock) GetRefund() uint64
- func (o *OutputContextMock) GetVMOutput() *vmcommon.VMOutput
- func (o *OutputContextMock) InitState()
- func (o *OutputContextMock) IsInterfaceNil() bool
- func (o *OutputContextMock) NewVMOutputAccount(address []byte) *vmcommon.OutputAccount
- func (o *OutputContextMock) NewVMOutputAccountFromMockAccount(account *worldmock.Account) *vmcommon.OutputAccount
- func (o *OutputContextMock) NextOutputTransferIndex() uint32
- func (o *OutputContextMock) PopDiscard()
- func (o *OutputContextMock) PopMergeActiveState()
- func (o *OutputContextMock) PopSetActiveState()
- func (o *OutputContextMock) PrependFinish(data []byte)
- func (o *OutputContextMock) PushState()
- func (o *OutputContextMock) RemoveNonUpdatedStorage()
- func (o *OutputContextMock) RemoveReturnData(_ uint32)
- func (o *OutputContextMock) ReturnCode() vmcommon.ReturnCode
- func (o *OutputContextMock) ReturnData() [][]byte
- func (o *OutputContextMock) ReturnMessage() string
- func (o *OutputContextMock) SetCrtTransferIndex(index uint32)
- func (o *OutputContextMock) SetRefund(refund uint64)
- func (o *OutputContextMock) SetReturnCode(returnCode vmcommon.ReturnCode)
- func (o *OutputContextMock) SetReturnMessage(returnMessage string)
- func (o *OutputContextMock) Transfer(_ []byte, _ []byte, _ uint64, _ uint64, _ *big.Int, _ []byte, _ []byte, ...) error
- func (o *OutputContextMock) TransferESDT(_ *vmhost.ESDTTransfersArgs, _ *vmcommon.ContractCallInput) (uint64, error)
- func (o *OutputContextMock) TransferValueOnly(_ []byte, _ []byte, _ *big.Int, _ bool) error
- func (o *OutputContextMock) WriteLog(_ []byte, _ [][]byte, _ [][]byte)
- func (o *OutputContextMock) WriteLogWithIdentifier(_ []byte, _ [][]byte, _ [][]byte, _ []byte)
- type OutputContextStub
- func (o *OutputContextStub) AddToActiveState(vmOutput *vmcommon.VMOutput)
- func (o *OutputContextStub) AddTxValueToAccount(address []byte, value *big.Int)
- func (o *OutputContextStub) CensorVMOutput()
- func (o *OutputContextStub) ClearReturnData()
- func (o *OutputContextStub) ClearStateStack()
- func (o *OutputContextStub) CopyTopOfStackToActiveState()
- func (o *OutputContextStub) CreateVMOutputInCaseOfError(err error) *vmcommon.VMOutput
- func (o *OutputContextStub) DeleteFirstReturnData()
- func (o *OutputContextStub) DeleteOutputAccount(address []byte)
- func (o *OutputContextStub) DeployCode(input vmhost.CodeDeployInput)
- func (o *OutputContextStub) Finish(data []byte)
- func (o *OutputContextStub) GetCrtTransferIndex() uint32
- func (o *OutputContextStub) GetOutputAccount(address []byte) (*vmcommon.OutputAccount, bool)
- func (o *OutputContextStub) GetOutputAccounts() map[string]*vmcommon.OutputAccount
- func (o *OutputContextStub) GetRefund() uint64
- func (o *OutputContextStub) GetVMOutput() *vmcommon.VMOutput
- func (o *OutputContextStub) InitState()
- func (o *OutputContextStub) IsInterfaceNil() bool
- func (o *OutputContextStub) NextOutputTransferIndex() uint32
- func (o *OutputContextStub) PopDiscard()
- func (o *OutputContextStub) PopMergeActiveState()
- func (o *OutputContextStub) PopSetActiveState()
- func (o *OutputContextStub) PrependFinish(data []byte)
- func (o *OutputContextStub) PushState()
- func (o *OutputContextStub) RemoveNonUpdatedStorage()
- func (o *OutputContextStub) RemoveReturnData(index uint32)
- func (o *OutputContextStub) ReturnCode() vmcommon.ReturnCode
- func (o *OutputContextStub) ReturnData() [][]byte
- func (o *OutputContextStub) ReturnMessage() string
- func (o *OutputContextStub) SetCrtTransferIndex(index uint32)
- func (o *OutputContextStub) SetRefund(refund uint64)
- func (o *OutputContextStub) SetReturnCode(returnCode vmcommon.ReturnCode)
- func (o *OutputContextStub) SetReturnMessage(message string)
- func (o *OutputContextStub) Transfer(destination []byte, sender []byte, gasLimit uint64, gasLocked uint64, ...) error
- func (o *OutputContextStub) TransferESDT(transfersArgs *vmhost.ESDTTransfersArgs, callInput *vmcommon.ContractCallInput) (uint64, error)
- func (o *OutputContextStub) TransferValueOnly(destination []byte, sender []byte, value *big.Int, checkPayable bool) error
- func (o *OutputContextStub) WriteLog(address []byte, topics [][]byte, data [][]byte)
- func (o *OutputContextStub) WriteLogWithIdentifier(address []byte, topics [][]byte, data [][]byte, identifier []byte)
- type RuntimeContextMock
- func (r *RuntimeContextMock) AddAsyncContextCall(_ []byte, _ *vmhost.AsyncGeneratedCall) error
- func (r *RuntimeContextMock) AddError(_ error, _ ...string)
- func (r *RuntimeContextMock) Arguments() [][]byte
- func (r *RuntimeContextMock) BaseOpsErrorShouldFailExecution() bool
- func (r *RuntimeContextMock) BigFloatAPIErrorShouldFailExecution() bool
- func (r *RuntimeContextMock) BigIntAPIErrorShouldFailExecution() bool
- func (r *RuntimeContextMock) CallSCFunction(_ string) error
- func (r *RuntimeContextMock) CleanInstance()
- func (r *RuntimeContextMock) ClearInstanceStack()
- func (r *RuntimeContextMock) ClearStateStack()
- func (r *RuntimeContextMock) ClearWarmInstanceCache()
- func (r *RuntimeContextMock) CountSameContractInstancesOnStack(_ []byte) uint64
- func (r *RuntimeContextMock) CryptoAPIErrorShouldFailExecution() bool
- func (r *RuntimeContextMock) EndExecution()
- func (r *RuntimeContextMock) ExtractCodeUpgradeFromArgs() ([]byte, []byte, error)
- func (r *RuntimeContextMock) FailExecution(_ error)
- func (r *RuntimeContextMock) FunctionName() string
- func (r *RuntimeContextMock) FunctionNameChecked() (string, error)
- func (r *RuntimeContextMock) GetAllErrors() error
- func (r *RuntimeContextMock) GetContextAddress() []byte
- func (r *RuntimeContextMock) GetCurrentTxHash() []byte
- func (r *RuntimeContextMock) GetInstance() executor.Instance
- func (r *RuntimeContextMock) GetInstanceStackSize() uint64
- func (context *RuntimeContextMock) GetInstanceTracker() vmhost.InstanceTracker
- func (r *RuntimeContextMock) GetOriginalCallerAddress() []byte
- func (r *RuntimeContextMock) GetOriginalTxHash() []byte
- func (r *RuntimeContextMock) GetPointsUsed() uint64
- func (r *RuntimeContextMock) GetPrevTxHash() []byte
- func (r *RuntimeContextMock) GetRuntimeBreakpointValue() vmhost.BreakpointValue
- func (r *RuntimeContextMock) GetSCCode() ([]byte, error)
- func (r *RuntimeContextMock) GetSCCodeSize() uint64
- func (r *RuntimeContextMock) GetVMExecutor() executor.Executor
- func (r *RuntimeContextMock) GetVMInput() *vmcommon.ContractCallInput
- func (r *RuntimeContextMock) GetVMType() []byte
- func (r *RuntimeContextMock) GetWarmInstance(codeHash []byte) (executor.Instance, bool)
- func (r *RuntimeContextMock) HasFunction(_ string) bool
- func (r *RuntimeContextMock) InitState()
- func (r *RuntimeContextMock) InitStateFromContractCallInput(_ *vmcommon.ContractCallInput)
- func (r *RuntimeContextMock) IsFunctionImported(_ string) bool
- func (r *RuntimeContextMock) IsWarmInstance() bool
- func (r *RuntimeContextMock) ManagedBufferAPIErrorShouldFailExecution() bool
- func (r *RuntimeContextMock) ManagedMapAPIErrorShouldFailExecution() bool
- func (r *RuntimeContextMock) MustVerifyNextContractCode()
- func (r *RuntimeContextMock) NumRunningInstances() (int, int)
- func (r *RuntimeContextMock) PopDiscard()
- func (r *RuntimeContextMock) PopInstance()
- func (r *RuntimeContextMock) PopSetActiveState()
- func (r *RuntimeContextMock) PrepareLegacyAsyncCall(_ []byte, _ []byte, _ []byte) error
- func (r *RuntimeContextMock) PushInstance()
- func (r *RuntimeContextMock) PushState()
- func (r *RuntimeContextMock) ReadOnly() bool
- func (context *RuntimeContextMock) ReplaceVMExecutor(vmExecutor executor.Executor)
- func (r *RuntimeContextMock) ResetWarmInstance()
- func (r *RuntimeContextMock) SetCaching(_ bool)
- func (r *RuntimeContextMock) SetCodeAddress(scAddress []byte)
- func (r *RuntimeContextMock) SetCustomCallFunction(_ string)
- func (r *RuntimeContextMock) SetMaxInstanceStackSize(uint64)
- func (r *RuntimeContextMock) SetOriginalCallerAddress(scAddress []byte)
- func (r *RuntimeContextMock) SetPointsUsed(gasPoints uint64)
- func (r *RuntimeContextMock) SetReadOnly(readOnly bool)
- func (r *RuntimeContextMock) SetRuntimeBreakpointValue(_ vmhost.BreakpointValue)
- func (r *RuntimeContextMock) SetVMInput(vmInput *vmcommon.ContractCallInput)
- func (r *RuntimeContextMock) SignalExit(_ int)
- func (r *RuntimeContextMock) SignalUserError(_ string)
- func (r *RuntimeContextMock) StartWasmerInstance(_ []byte, _ uint64, _ bool) error
- func (r *RuntimeContextMock) SyncExecAPIErrorShouldFailExecution() bool
- func (r *RuntimeContextMock) ValidateCallbackName(_ string) error
- func (r *RuntimeContextMock) ValidateInstances() error
- func (r *RuntimeContextMock) VerifyContractCode() error
- type RuntimeContextWrapper
- func (contextWrapper *RuntimeContextWrapper) AddError(err error, otherInfo ...string)
- func (contextWrapper *RuntimeContextWrapper) Arguments() [][]byte
- func (contextWrapper *RuntimeContextWrapper) BaseOpsErrorShouldFailExecution() bool
- func (contextWrapper *RuntimeContextWrapper) BigFloatAPIErrorShouldFailExecution() bool
- func (contextWrapper *RuntimeContextWrapper) BigIntAPIErrorShouldFailExecution() bool
- func (contextWrapper *RuntimeContextWrapper) CallSCFunction(functionName string) error
- func (contextWrapper *RuntimeContextWrapper) CleanInstance()
- func (contextWrapper *RuntimeContextWrapper) ClearStateStack()
- func (contextWrapper *RuntimeContextWrapper) ClearWarmInstanceCache()
- func (contextWrapper *RuntimeContextWrapper) CountSameContractInstancesOnStack(address []byte) uint64
- func (contextWrapper *RuntimeContextWrapper) CryptoAPIErrorShouldFailExecution() bool
- func (contextWrapper *RuntimeContextWrapper) EndExecution()
- func (contextWrapper *RuntimeContextWrapper) ExtractCodeUpgradeFromArgs() ([]byte, []byte, error)
- func (contextWrapper *RuntimeContextWrapper) FailExecution(err error)
- func (contextWrapper *RuntimeContextWrapper) FunctionName() string
- func (contextWrapper *RuntimeContextWrapper) FunctionNameChecked() (string, error)
- func (contextWrapper *RuntimeContextWrapper) GetAllErrors() error
- func (contextWrapper *RuntimeContextWrapper) GetContextAddress() []byte
- func (contextWrapper *RuntimeContextWrapper) GetCurrentTxHash() []byte
- func (contextWrapper *RuntimeContextWrapper) GetInstance() executor.Instance
- func (contextWrapper *RuntimeContextWrapper) GetInstanceStackSize() uint64
- func (contextWrapper *RuntimeContextWrapper) GetInstanceTracker() vmhost.InstanceTracker
- func (contextWrapper *RuntimeContextWrapper) GetOriginalCallerAddress() []byte
- func (contextWrapper *RuntimeContextWrapper) GetOriginalTxHash() []byte
- func (contextWrapper *RuntimeContextWrapper) GetPointsUsed() uint64
- func (contextWrapper *RuntimeContextWrapper) GetPrevTxHash() []byte
- func (contextWrapper *RuntimeContextWrapper) GetRuntimeBreakpointValue() vmhost.BreakpointValue
- func (contextWrapper *RuntimeContextWrapper) GetSCCode() ([]byte, error)
- func (contextWrapper *RuntimeContextWrapper) GetSCCodeSize() uint64
- func (contextWrapper *RuntimeContextWrapper) GetVMExecutor() executor.Executor
- func (contextWrapper *RuntimeContextWrapper) GetVMInput() *vmcommon.ContractCallInput
- func (contextWrapper *RuntimeContextWrapper) GetVMType() []byte
- func (contextWrapper *RuntimeContextWrapper) GetWrappedRuntimeContext() vmhost.RuntimeContext
- func (contextWrapper *RuntimeContextWrapper) HasFunction(functionName string) bool
- func (contextWrapper *RuntimeContextWrapper) InitState()
- func (contextWrapper *RuntimeContextWrapper) InitStateFromContractCallInput(input *vmcommon.ContractCallInput)
- func (contextWrapper *RuntimeContextWrapper) IsFunctionImported(name string) bool
- func (contextWrapper *RuntimeContextWrapper) ManagedBufferAPIErrorShouldFailExecution() bool
- func (contextWrapper *RuntimeContextWrapper) ManagedMapAPIErrorShouldFailExecution() bool
- func (contextWrapper *RuntimeContextWrapper) MustVerifyNextContractCode()
- func (contextWrapper *RuntimeContextWrapper) PopDiscard()
- func (contextWrapper *RuntimeContextWrapper) PopSetActiveState()
- func (contextWrapper *RuntimeContextWrapper) PushState()
- func (contextWrapper *RuntimeContextWrapper) ReadOnly() bool
- func (contextWrapper *RuntimeContextWrapper) ReplaceVMExecutor(vmExecutor executor.Executor)
- func (contextWrapper *RuntimeContextWrapper) SetCodeAddress(scAddress []byte)
- func (contextWrapper *RuntimeContextWrapper) SetCustomCallFunction(callFunction string)
- func (contextWrapper *RuntimeContextWrapper) SetMaxInstanceStackSize(maxInstanceStackSize uint64)
- func (contextWrapper *RuntimeContextWrapper) SetPointsUsed(gasPoints uint64)
- func (contextWrapper *RuntimeContextWrapper) SetReadOnly(readOnly bool)
- func (contextWrapper *RuntimeContextWrapper) SetRuntimeBreakpointValue(value vmhost.BreakpointValue)
- func (contextWrapper *RuntimeContextWrapper) SetVMInput(vmInput *vmcommon.ContractCallInput)
- func (contextWrapper *RuntimeContextWrapper) SignalUserError(message string)
- func (contextWrapper *RuntimeContextWrapper) StartWasmerInstance(contract []byte, gasLimit uint64, newCode bool) error
- func (contextWrapper *RuntimeContextWrapper) SyncExecAPIErrorShouldFailExecution() bool
- func (contextWrapper *RuntimeContextWrapper) ValidateCallbackName(callbackName string) error
- func (contextWrapper *RuntimeContextWrapper) ValidateInstances() error
- func (contextWrapper *RuntimeContextWrapper) VerifyContractCode() error
- type StubAccount
- func (a *StubAccount) AccountDataHandler() vmcommon.AccountDataHandler
- func (a *StubAccount) AddToBalance(_ *big.Int) error
- func (a *StubAccount) AddressBytes() []byte
- func (a *StubAccount) ChangeOwnerAddress(_ []byte, _ []byte) error
- func (a *StubAccount) ClaimDeveloperRewards(_ []byte) (*big.Int, error)
- func (a *StubAccount) GetBalance() *big.Int
- func (a *StubAccount) GetCodeHash() []byte
- func (a *StubAccount) GetCodeMetadata() []byte
- func (a *StubAccount) GetDeveloperReward() *big.Int
- func (a *StubAccount) GetNonce() uint64
- func (a *StubAccount) GetOwnerAddress() []byte
- func (a *StubAccount) GetRootHash() []byte
- func (a *StubAccount) GetUserName() []byte
- func (a *StubAccount) IncreaseNonce(_ uint64)
- func (a *StubAccount) IsInterfaceNil() bool
- func (a *StubAccount) SetCodeMetadata(_ []byte)
- func (a *StubAccount) SetOwnerAddress(_ []byte)
- func (a *StubAccount) SetUserName(_ []byte)
- type VMHostMock
- func (host *VMHostMock) AreInSameShard(left []byte, right []byte) bool
- func (host *VMHostMock) Async() vmhost.AsyncContext
- func (host *VMHostMock) Blockchain() vmhost.BlockchainContext
- func (host *VMHostMock) ClearStateStack()
- func (host *VMHostMock) Close() error
- func (host *VMHostMock) CompleteLogEntriesWithCallType(vmOutput *vmcommon.VMOutput, callType string)
- func (host *VMHostMock) CreateNewContract(_ *vmcommon.ContractCreateInput, _ int) ([]byte, error)
- func (host *VMHostMock) Crypto() crypto.VMCrypto
- func (host *VMHostMock) EnableEpochsHandler() vmhost.EnableEpochsHandler
- func (host *VMHostMock) EnqueueVMOutput(vmOutput *vmcommon.VMOutput)
- func (host *VMHostMock) ExecuteESDTTransfer(_ *vmhost.ESDTTransfersArgs, _ vm.CallType) (*vmcommon.VMOutput, uint64, error)
- func (host *VMHostMock) ExecuteOnDestContext(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, bool, error)
- func (host *VMHostMock) ExecuteOnSameContext(_ *vmcommon.ContractCallInput) error
- func (host *VMHostMock) FixOOGReturnCodeEnabled() bool
- func (host *VMHostMock) GasScheduleChange(_ config.GasScheduleMap)
- func (host *VMHostMock) GetContexts() (vmhost.ManagedTypesContext, vmhost.BlockchainContext, vmhost.MeteringContext, ...)
- func (host *VMHostMock) GetGasScheduleMap() config.GasScheduleMap
- func (host *VMHostMock) GetNextVMOutput() *vmcommon.VMOutput
- func (host *VMHostMock) GetVersion() string
- func (host *VMHostMock) InitState()
- func (host *VMHostMock) IsAheadOfTimeCompileEnabled() bool
- func (host *VMHostMock) IsBuiltinFunctionCall(_ []byte) bool
- func (host *VMHostMock) IsBuiltinFunctionName(_ string) bool
- func (host *VMHostMock) IsDynamicGasLockingEnabled() bool
- func (host *VMHostMock) IsESDTFunctionsEnabled() bool
- func (host *VMHostMock) IsInterfaceNil() bool
- func (host *VMHostMock) ManagedTypes() vmhost.ManagedTypesContext
- func (host *VMHostMock) Metering() vmhost.MeteringContext
- func (host *VMHostMock) Output() vmhost.OutputContext
- func (host *VMHostMock) PopState()
- func (host *VMHostMock) PushState()
- func (host *VMHostMock) Reset()
- func (host *VMHostMock) RunSmartContractCall(_ *vmcommon.ContractCallInput) (vmOutput *vmcommon.VMOutput, err error)
- func (host *VMHostMock) RunSmartContractCreate(_ *vmcommon.ContractCreateInput) (vmOutput *vmcommon.VMOutput, err error)
- func (host *VMHostMock) Runtime() vmhost.RuntimeContext
- func (host *VMHostMock) SetBuiltInFunctionsContainer(_ vmcommon.BuiltInFunctionContainer)
- func (host *VMHostMock) SetRuntimeContext(runtime vmhost.RuntimeContext)
- func (host *VMHostMock) Storage() vmhost.StorageContext
- func (host *VMHostMock) StoreInput(input *vmcommon.ContractCallInput)
- type VMHostStub
- func (vhs *VMHostStub) AreInSameShard(left []byte, right []byte) bool
- func (vhs *VMHostStub) Async() vmhost.AsyncContext
- func (vhs *VMHostStub) Blockchain() vmhost.BlockchainContext
- func (vhs *VMHostStub) ClearStateStack()
- func (vhs *VMHostStub) Close() error
- func (vhs *VMHostStub) CompleteLogEntriesWithCallType(vmOutput *vmcommon.VMOutput, callType string)
- func (vhs *VMHostStub) CreateNewContract(input *vmcommon.ContractCreateInput, createContractCallType int) ([]byte, error)
- func (vhs *VMHostStub) Crypto() crypto.VMCrypto
- func (vhs *VMHostStub) EnableEpochsHandler() vmhost.EnableEpochsHandler
- func (vhs *VMHostStub) ExecuteESDTTransfer(transfersArgs *vmhost.ESDTTransfersArgs, callType vm.CallType) (*vmcommon.VMOutput, uint64, error)
- func (vhs *VMHostStub) ExecuteOnDestContext(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, bool, error)
- func (vhs *VMHostStub) ExecuteOnSameContext(input *vmcommon.ContractCallInput) error
- func (vhs *VMHostStub) GasScheduleChange(newGasSchedule config.GasScheduleMap)
- func (vhs *VMHostStub) GetContexts() (vmhost.ManagedTypesContext, vmhost.BlockchainContext, vmhost.MeteringContext, ...)
- func (vhs *VMHostStub) GetGasScheduleMap() config.GasScheduleMap
- func (vhs *VMHostStub) GetVersion() string
- func (vhs *VMHostStub) InitState()
- func (vhs *VMHostStub) IsAheadOfTimeCompileEnabled() bool
- func (vhs *VMHostStub) IsBuiltinFunctionCall(data []byte) bool
- func (vhs *VMHostStub) IsBuiltinFunctionName(functionName string) bool
- func (vhs *VMHostStub) IsDynamicGasLockingEnabled() bool
- func (vhs *VMHostStub) IsESDTFunctionsEnabled() bool
- func (vhs *VMHostStub) IsInterfaceNil() bool
- func (vhs *VMHostStub) ManagedTypes() vmhost.ManagedTypesContext
- func (vhs *VMHostStub) Metering() vmhost.MeteringContext
- func (vhs *VMHostStub) Output() vmhost.OutputContext
- func (vhs *VMHostStub) PopState()
- func (vhs *VMHostStub) PushState()
- func (vhs *VMHostStub) Reset()
- func (vhs *VMHostStub) RunSmartContractCall(input *vmcommon.ContractCallInput) (vmOutput *vmcommon.VMOutput, err error)
- func (vhs *VMHostStub) RunSmartContractCreate(input *vmcommon.ContractCreateInput) (vmOutput *vmcommon.VMOutput, err error)
- func (vhs *VMHostStub) Runtime() vmhost.RuntimeContext
- func (vhs *VMHostStub) SetBuiltInFunctionsContainer(builtInFuncs vmcommon.BuiltInFunctionContainer)
- func (vhs *VMHostStub) SetRuntimeContext(runtime vmhost.RuntimeContext)
- func (vhs *VMHostStub) Storage() vmhost.StorageContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockchainHookStub ¶
type BlockchainHookStub struct { NewAddressCalled func(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error) GetStorageDataCalled func(accountsAddress []byte, index []byte) ([]byte, uint32, 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 ProcessBuiltInFunctionCalled func(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error) GetBuiltinFunctionNamesCalled func() vmcommon.FunctionNames GetAllStateCalled func(address []byte) (map[string][]byte, error) GetUserAccountCalled func(address []byte) (vmcommon.UserAccountHandler, error) GetShardOfAddressCalled func(address []byte) uint32 IsSmartContractCalled func(address []byte) bool IsPayableCalled func(address []byte) (bool, error) GetCompiledCodeCalled func(codeHash []byte) (bool, []byte) SaveCompiledCodeCalled func(codeHash []byte, code []byte) GetCodeCalled func(account vmcommon.UserAccountHandler) []byte GetESDTTokenCalled func(address []byte, tokenID []byte, nonce uint64) (*esdt.ESDigitalToken, error) GetSnapshotCalled func() int RevertToSnapshotCalled func(snapshot int) error ExecuteSmartContractCallOnOtherVMCalled func(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error) }
BlockchainHookStub is used in tests to check that interface methods were called
func (*BlockchainHookStub) ClearCompiledCodes ¶
func (b *BlockchainHookStub) ClearCompiledCodes()
ClearCompiledCodes mocked method
func (*BlockchainHookStub) CurrentEpoch ¶
func (b *BlockchainHookStub) CurrentEpoch() uint32
CurrentEpoch mocked method
func (*BlockchainHookStub) CurrentNonce ¶
func (b *BlockchainHookStub) CurrentNonce() uint64
CurrentNonce mocked method
func (*BlockchainHookStub) CurrentRandomSeed ¶
func (b *BlockchainHookStub) CurrentRandomSeed() []byte
CurrentRandomSeed mocked method
func (*BlockchainHookStub) CurrentRound ¶
func (b *BlockchainHookStub) CurrentRound() uint64
CurrentRound mocked method
func (*BlockchainHookStub) CurrentTimeStamp ¶
func (b *BlockchainHookStub) CurrentTimeStamp() uint64
CurrentTimeStamp mocked method
func (*BlockchainHookStub) ExecuteSmartContractCallOnOtherVM ¶
func (b *BlockchainHookStub) ExecuteSmartContractCallOnOtherVM(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
ExecuteSmartContractCallOnOtherVM -
func (*BlockchainHookStub) GetAllState ¶
func (b *BlockchainHookStub) GetAllState(address []byte) (map[string][]byte, error)
GetAllState mocked method
func (*BlockchainHookStub) GetBlockhash ¶
func (b *BlockchainHookStub) GetBlockhash(nonce uint64) ([]byte, error)
GetBlockhash mocked method
func (*BlockchainHookStub) GetBuiltinFunctionNames ¶
func (b *BlockchainHookStub) GetBuiltinFunctionNames() vmcommon.FunctionNames
GetBuiltinFunctionNames mocked method
func (*BlockchainHookStub) GetCode ¶
func (b *BlockchainHookStub) GetCode(account vmcommon.UserAccountHandler) []byte
GetCode mocked method
func (*BlockchainHookStub) GetCompiledCode ¶
func (b *BlockchainHookStub) GetCompiledCode(codeHash []byte) (bool, []byte)
GetCompiledCode mocked method
func (*BlockchainHookStub) GetESDTToken ¶
func (b *BlockchainHookStub) GetESDTToken(address []byte, tokenID []byte, nonce uint64) (*esdt.ESDigitalToken, error)
GetESDTToken mocked method
func (*BlockchainHookStub) GetShardOfAddress ¶
func (b *BlockchainHookStub) GetShardOfAddress(address []byte) uint32
GetShardOfAddress mocked method
func (*BlockchainHookStub) GetSnapshot ¶
func (b *BlockchainHookStub) GetSnapshot() int
GetSnapshot mocked method
func (*BlockchainHookStub) GetStateRootHash ¶
func (b *BlockchainHookStub) GetStateRootHash() []byte
GetStateRootHash mocked method
func (*BlockchainHookStub) GetStorageData ¶
func (b *BlockchainHookStub) GetStorageData(accountAddress []byte, index []byte) ([]byte, uint32, error)
GetStorageData mocked method
func (*BlockchainHookStub) GetUserAccount ¶
func (b *BlockchainHookStub) GetUserAccount(address []byte) (vmcommon.UserAccountHandler, error)
GetUserAccount mocked method
func (*BlockchainHookStub) IsInterfaceNil ¶
func (b *BlockchainHookStub) IsInterfaceNil() bool
IsInterfaceNil mocked method
func (*BlockchainHookStub) IsLimitedTransfer ¶
func (b *BlockchainHookStub) IsLimitedTransfer(_ []byte) bool
IsLimitedTransfer -
func (*BlockchainHookStub) IsPaused ¶
func (b *BlockchainHookStub) IsPaused(_ []byte) bool
IsPaused -
func (*BlockchainHookStub) IsPayable ¶
func (b *BlockchainHookStub) IsPayable(_, address []byte) (bool, error)
IsPayable mocked method
func (*BlockchainHookStub) IsSmartContract ¶
func (b *BlockchainHookStub) IsSmartContract(address []byte) bool
IsSmartContract mocked method
func (*BlockchainHookStub) LastEpoch ¶
func (b *BlockchainHookStub) LastEpoch() uint32
LastEpoch mocked method
func (*BlockchainHookStub) LastNonce ¶
func (b *BlockchainHookStub) LastNonce() uint64
LastNonce mocked method
func (*BlockchainHookStub) LastRandomSeed ¶
func (b *BlockchainHookStub) LastRandomSeed() []byte
LastRandomSeed mocked method
func (*BlockchainHookStub) LastRound ¶
func (b *BlockchainHookStub) LastRound() uint64
LastRound mocked method
func (*BlockchainHookStub) LastTimeStamp ¶
func (b *BlockchainHookStub) LastTimeStamp() uint64
LastTimeStamp mocked method
func (*BlockchainHookStub) NewAddress ¶
func (b *BlockchainHookStub) NewAddress(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)
NewAddress mocked method
func (*BlockchainHookStub) ProcessBuiltInFunction ¶
func (b *BlockchainHookStub) ProcessBuiltInFunction(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
ProcessBuiltInFunction mocked method
func (*BlockchainHookStub) RevertToSnapshot ¶
func (b *BlockchainHookStub) RevertToSnapshot(snapshot int) error
RevertToSnapshot mocked method
func (*BlockchainHookStub) SaveCompiledCode ¶
func (b *BlockchainHookStub) SaveCompiledCode(codeHash []byte, code []byte)
SaveCompiledCode mocked method
type CryptoHookMock ¶
CryptoHookMock is used in tests to check that interface methods were called
func (*CryptoHookMock) EncodeSecp256k1DERSignature ¶
func (c *CryptoHookMock) EncodeSecp256k1DERSignature(_, _ []byte) []byte
EncodeSecp256k1DERSignature mocked method
func (*CryptoHookMock) Keccak256 ¶
func (c *CryptoHookMock) Keccak256(_ []byte) ([]byte, error)
Keccak256 mocked method
func (*CryptoHookMock) Ripemd160 ¶
func (c *CryptoHookMock) Ripemd160(_ []byte) ([]byte, error)
Ripemd160 mocked method
func (*CryptoHookMock) Sha256 ¶
func (c *CryptoHookMock) Sha256(_ []byte) ([]byte, error)
Sha256 mocked method
func (*CryptoHookMock) VerifyBLS ¶
func (c *CryptoHookMock) VerifyBLS(_ []byte, _ []byte, _ []byte) error
VerifyBLS mocked method
func (*CryptoHookMock) VerifyEd25519 ¶
func (c *CryptoHookMock) VerifyEd25519(_ []byte, _ []byte, _ []byte) error
VerifyEd25519 mocked method
func (*CryptoHookMock) VerifySecp256k1 ¶
VerifySecp256k1 mocked method
type ExecutorMock ¶
type ExecutorMock struct { InstanceMap map[string]InstanceMock World *worldmock.MockWorld }
ExecutorMock can be passed to RuntimeContext as an InstanceBuilder to create mocked Wasmer instances.
func NewExecutorMock ¶
func NewExecutorMock(world *worldmock.MockWorld) *ExecutorMock
NewExecutorMock constructs a new InstanceBuilderMock
func (*ExecutorMock) CreateAndStoreInstanceMock ¶
func (executorMock *ExecutorMock) CreateAndStoreInstanceMock(t testing.TB, host vmhost.VMHost, code []byte, codeHash []byte, codeMetadata []byte, ownerAddress []byte, shardID uint32, balance int64, createAccount bool) *InstanceMock
CreateAndStoreInstanceMock creates a new InstanceMock and registers it as a smart contract account in the World, using `code` as the address of the account
func (*ExecutorMock) FunctionNames ¶
func (executorMock *ExecutorMock) FunctionNames() vmcommon.FunctionNames
FunctionNames mocked method
func (*ExecutorMock) IsInterfaceNil ¶
func (executorMock *ExecutorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ExecutorMock) NewInstanceFromCompiledCodeWithOptions ¶
func (executorMock *ExecutorMock) NewInstanceFromCompiledCodeWithOptions( compiledCode []byte, options executor.CompilationOptions, ) (executor.Instance, error)
NewInstanceFromCompiledCodeWithOptions attempts to load a prepared instance using GetStoredInstance; if it doesn't exist, it creates a true Wasmer instance with the provided precompiled code.
func (*ExecutorMock) NewInstanceWithOptions ¶
func (executorMock *ExecutorMock) NewInstanceWithOptions( contractCode []byte, options executor.CompilationOptions, ) (executor.Instance, error)
NewInstanceWithOptions attempts to load a prepared instance using GetStoredInstance; if it doesn't exist, it creates a true Wasmer instance with the provided contract code.
func (*ExecutorMock) SetOpcodeCosts ¶
func (executorMock *ExecutorMock) SetOpcodeCosts(_ *executor.WASMOpcodeCost)
SetOpcodeCosts should set gas costs, but it does nothing in the case of this mock.
type ExecutorMockFactory ¶
type ExecutorMockFactory struct { World *worldmock.MockWorld // gives access to the created Executor in tests LastCreatedExecutor *ExecutorMock }
ExecutorMockFactory is the factory for the ExecutorRecorderMock.
func NewExecutorMockFactory ¶
func NewExecutorMockFactory(world *worldmock.MockWorld) *ExecutorMockFactory
NewExecutorMockFactory returns the Wasmer executor factory.
func (*ExecutorMockFactory) CreateExecutor ¶
func (emf *ExecutorMockFactory) CreateExecutor(_ executor.ExecutorFactoryArgs) (executor.Executor, error)
CreateExecutor creates a new Executor instance.
func (*ExecutorMockFactory) IsInterfaceNil ¶
func (emf *ExecutorMockFactory) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type InstanceMock ¶
type InstanceMock struct { Code []byte Exports wasmer.ExportsMap DefaultErrors map[string]error Methods map[string]mockMethod Points uint64 Data executor.VMHooks GasLimit uint64 BreakpointValue vmhost.BreakpointValue Memory executor.Memory Host vmhost.VMHost T testing.TB Address []byte AlreadyClean bool }
InstanceMock is a mock for Wasmer instances; it allows creating mock smart contracts within tests, without needing actual WASM smart contracts.
func GetMockInstance ¶
func GetMockInstance(host vmhost.VMHost) *InstanceMock
GetMockInstance gets the mock instance from the runtime of the provided host
func NewInstanceMock ¶
func NewInstanceMock(code []byte) *InstanceMock
NewInstanceMock creates a new InstanceMock
func (*InstanceMock) AddMockMethod ¶
func (instance *InstanceMock) AddMockMethod(name string, method mockMethod)
AddMockMethod adds the provided function as a mocked method to the instance under the specified name.
func (*InstanceMock) AddMockMethodWithError ¶
func (instance *InstanceMock) AddMockMethodWithError(name string, method mockMethod, err error)
AddMockMethodWithError adds the provided function as a mocked method to the instance under the specified name and returns an error
func (*InstanceMock) Cache ¶
func (instance *InstanceMock) Cache() ([]byte, error)
Cache mocked method
func (*InstanceMock) CallFunction ¶
func (instance *InstanceMock) CallFunction(funcName string) error
CallFunction mocked method
func (*InstanceMock) GetBreakpointValue ¶
func (instance *InstanceMock) GetBreakpointValue() uint64
GetBreakpointValue mocked method
func (*InstanceMock) GetFunctionNames ¶
func (instance *InstanceMock) GetFunctionNames() []string
GetFunctionNames mocked method
func (*InstanceMock) GetPointsUsed ¶
func (instance *InstanceMock) GetPointsUsed() uint64
GetPointsUsed mocked method
func (*InstanceMock) GetVMHooksPtr ¶
func (instance *InstanceMock) GetVMHooksPtr() uintptr
GetVMHooksPtr mocked method
func (*InstanceMock) HasFunction ¶
func (instance *InstanceMock) HasFunction(name string) bool
HasFunction mocked method
func (*InstanceMock) HasMemory ¶
func (instance *InstanceMock) HasMemory() bool
HasMemory mocked method
func (*InstanceMock) ID ¶
func (instance *InstanceMock) ID() string
ID returns an identifier for the instance, unique at runtime
func (*InstanceMock) IsAlreadyCleaned ¶
func (instance *InstanceMock) IsAlreadyCleaned() bool
IsAlreadyCleaned mocked method
func (*InstanceMock) IsFunctionImported ¶
func (instance *InstanceMock) IsFunctionImported(name string) bool
IsFunctionImported mocked method
func (*InstanceMock) IsInterfaceNil ¶
func (instance *InstanceMock) IsInterfaceNil() bool
IsInterfaceNil mocked method
func (*InstanceMock) MemDump ¶
func (instance *InstanceMock) MemDump() []byte
MemDump yields the entire contents of the memory. Only used in tests.
func (*InstanceMock) MemGrow ¶
func (instance *InstanceMock) MemGrow(pages uint32) error
MemGrow allocates more pages to the current memory. Only called directly in tests.
func (*InstanceMock) MemLength ¶
func (instance *InstanceMock) MemLength() uint32
MemLength returns the length of the allocated memory. Only called directly in tests.
func (*InstanceMock) MemLoad ¶
func (instance *InstanceMock) MemLoad(memPtr executor.MemPtr, length executor.MemLength) ([]byte, error)
MemLoad returns the contents from the given offset of the WASM memory.
func (*InstanceMock) MemStore ¶
func (instance *InstanceMock) MemStore(memPtr executor.MemPtr, data []byte) error
MemStore stores the given data in the WASM memory at the given offset.
func (*InstanceMock) SetBreakpointValue ¶
func (instance *InstanceMock) SetBreakpointValue(value uint64)
SetBreakpointValue mocked method
func (*InstanceMock) SetGasLimit ¶
func (instance *InstanceMock) SetGasLimit(gasLimit uint64)
SetGasLimit mocked method
func (*InstanceMock) SetPointsUsed ¶
func (instance *InstanceMock) SetPointsUsed(points uint64)
SetPointsUsed mocked method
func (*InstanceMock) SetVMHooksPtr ¶
func (instance *InstanceMock) SetVMHooksPtr(_ uintptr)
SetVMHooksPtr mocked method
func (*InstanceMock) ValidateFunctionArities ¶
func (instance *InstanceMock) ValidateFunctionArities() error
ValidateFunctionArities mocked method
func (*InstanceMock) ValidateVoidFunction ¶
func (instance *InstanceMock) ValidateVoidFunction(_ string) error
ValidateVoidFunction mocked method
type MemoryMock ¶
MemoryMock mocks the linear memory of a Wasmer instance and is used by the InstanceMock.
func NewMemoryMock ¶
func NewMemoryMock() *MemoryMock
NewMemoryMock creates a new MemoryMock instance
func (*MemoryMock) IsInterfaceNil ¶
func (memory *MemoryMock) IsInterfaceNil() bool
IsInterfaceNil returns true if underlying object is nil
type MeteringContextMock ¶
type MeteringContextMock struct { GasCost *config.GasCost GasLeftMock uint64 GasFreedMock uint64 GasLockedMock uint64 GasProvidedMock uint64 GasComputedToLock uint64 BlockGasLimitMock uint64 Err error }
MeteringContextMock is used in tests to check the MeteringContext interface method calls
func (*MeteringContextMock) BlockGasLimit ¶
func (m *MeteringContextMock) BlockGasLimit() uint64
BlockGasLimit mocked method
func (*MeteringContextMock) BoundGasLimit ¶
func (m *MeteringContextMock) BoundGasLimit(value int64) uint64
BoundGasLimit mocked method
func (*MeteringContextMock) ClearStateStack ¶
func (m *MeteringContextMock) ClearStateStack()
ClearStateStack mocked method
func (*MeteringContextMock) ComputeExtraGasLockedForAsync ¶
func (m *MeteringContextMock) ComputeExtraGasLockedForAsync() uint64
ComputeExtraGasLockedForAsync mocked method
func (*MeteringContextMock) DeductGasIfAsyncStep ¶
func (m *MeteringContextMock) DeductGasIfAsyncStep() error
DeductGasIfAsyncStep mocked method
func (*MeteringContextMock) DeductInitialGasForDirectDeployment ¶
func (m *MeteringContextMock) DeductInitialGasForDirectDeployment(_ vmhost.CodeDeployInput) error
DeductInitialGasForDirectDeployment mocked method
func (*MeteringContextMock) DeductInitialGasForExecution ¶
func (m *MeteringContextMock) DeductInitialGasForExecution(_ []byte) error
DeductInitialGasForExecution mocked method
func (*MeteringContextMock) DeductInitialGasForIndirectDeployment ¶
func (m *MeteringContextMock) DeductInitialGasForIndirectDeployment(_ vmhost.CodeDeployInput) error
DeductInitialGasForIndirectDeployment mocked method
func (*MeteringContextMock) DisableRestoreGas ¶
func (m *MeteringContextMock) DisableRestoreGas()
DisableRestoreGas mocked method
func (*MeteringContextMock) EnableRestoreGas ¶
func (m *MeteringContextMock) EnableRestoreGas()
EnableRestoreGas mocked method
func (*MeteringContextMock) FreeGas ¶
func (m *MeteringContextMock) FreeGas(gas uint64)
FreeGas mocked method
func (*MeteringContextMock) GasLeft ¶
func (m *MeteringContextMock) GasLeft() uint64
GasLeft mocked method
func (*MeteringContextMock) GasSchedule ¶
func (m *MeteringContextMock) GasSchedule() *config.GasCost
GasSchedule mocked method
func (*MeteringContextMock) GasSpentByContract ¶
func (m *MeteringContextMock) GasSpentByContract() uint64
GasSpentByContract mocked method
func (*MeteringContextMock) GasUsedByContract ¶
func (m *MeteringContextMock) GasUsedByContract() (uint64, uint64)
GasUsedByContract mocked method
func (*MeteringContextMock) GasUsedForExecution ¶
func (m *MeteringContextMock) GasUsedForExecution() uint64
GasUsedForExecution mocked method
func (*MeteringContextMock) GetGasForExecution ¶
func (m *MeteringContextMock) GetGasForExecution() uint64
GetGasForExecution mocked method
func (*MeteringContextMock) GetGasLocked ¶
func (m *MeteringContextMock) GetGasLocked() uint64
GetGasLocked mocked method
func (*MeteringContextMock) GetGasProvided ¶
func (m *MeteringContextMock) GetGasProvided() uint64
GetGasProvided mocked method
func (*MeteringContextMock) GetGasTrace ¶
func (m *MeteringContextMock) GetGasTrace() map[string]map[string][]uint64
GetGasTrace returns nil
func (*MeteringContextMock) GetSCPrepareInitialCost ¶
func (m *MeteringContextMock) GetSCPrepareInitialCost() uint64
GetSCPrepareInitialCost mocked method
func (*MeteringContextMock) InitState ¶
func (m *MeteringContextMock) InitState()
InitState mocked method
func (*MeteringContextMock) InitStateFromContractCallInput ¶
func (m *MeteringContextMock) InitStateFromContractCallInput(_ *vmcommon.VMInput)
InitStateFromContractCallInput mocked method
func (*MeteringContextMock) PopDiscard ¶
func (m *MeteringContextMock) PopDiscard()
PopDiscard mocked method
func (*MeteringContextMock) PopMergeActiveState ¶
func (m *MeteringContextMock) PopMergeActiveState()
PopMergeActiveState mocked method
func (*MeteringContextMock) PopSetActiveState ¶
func (m *MeteringContextMock) PopSetActiveState()
PopSetActiveState mocked method
func (*MeteringContextMock) PushState ¶
func (m *MeteringContextMock) PushState()
PushState mocked method
func (*MeteringContextMock) RestoreGas ¶
func (m *MeteringContextMock) RestoreGas(gas uint64)
RestoreGas mocked method
func (*MeteringContextMock) SetGasSchedule ¶
func (m *MeteringContextMock) SetGasSchedule(gasSchedule config.GasScheduleMap)
SetGasSchedule mocked method
func (*MeteringContextMock) SetGasTracing ¶
func (m *MeteringContextMock) SetGasTracing(_ bool)
SetGasTracing mocked method
func (*MeteringContextMock) StartGasTracing ¶
func (m *MeteringContextMock) StartGasTracing(_ string)
StartGasTracing mocked method
func (*MeteringContextMock) TrackGasUsedByOutOfVMFunction ¶
func (m *MeteringContextMock) TrackGasUsedByOutOfVMFunction(_ *vmcommon.ContractCallInput, _ *vmcommon.VMOutput, _ *vmcommon.ContractCallInput)
TrackGasUsedByOutOfVMFunction mocked method
func (*MeteringContextMock) UnlockGasIfAsyncCallback ¶
func (m *MeteringContextMock) UnlockGasIfAsyncCallback()
UnlockGasIfAsyncCallback mocked method
func (*MeteringContextMock) UnlockGasIfAsyncStep ¶
func (m *MeteringContextMock) UnlockGasIfAsyncStep()
UnlockGasIfAsyncStep mocked method
func (*MeteringContextMock) UpdateGasStateOnFailure ¶
func (m *MeteringContextMock) UpdateGasStateOnFailure(_ *vmcommon.VMOutput)
UpdateGasStateOnFailure mocked method
func (*MeteringContextMock) UpdateGasStateOnSuccess ¶
func (m *MeteringContextMock) UpdateGasStateOnSuccess(_ *vmcommon.VMOutput) error
UpdateGasStateOnSuccess mocked method
func (*MeteringContextMock) UseAndTraceGas ¶
func (m *MeteringContextMock) UseAndTraceGas(_ uint64)
UseAndTraceGas mocked method
func (*MeteringContextMock) UseGas ¶
func (m *MeteringContextMock) UseGas(gas uint64)
UseGas mocked method
func (*MeteringContextMock) UseGasAndAddTracedGas ¶
func (m *MeteringContextMock) UseGasAndAddTracedGas(_ string, _ uint64)
UseGasAndAddTracedGas mocked method
func (*MeteringContextMock) UseGasBounded ¶
func (m *MeteringContextMock) UseGasBounded(gas uint64) error
UseGasBounded mocked method
func (*MeteringContextMock) UseGasBoundedAndAddTracedGas ¶ added in v1.5.6
func (m *MeteringContextMock) UseGasBoundedAndAddTracedGas(_ string, _ uint64) error
UseGasBoundedAndAddTracedGas -
func (*MeteringContextMock) UseGasForAsyncStep ¶
func (m *MeteringContextMock) UseGasForAsyncStep() error
UseGasForAsyncStep mocked method
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 CrtTransferIndex uint32 }
OutputContextMock is used in tests to check the OutputContext interface method calls
func (*OutputContextMock) AddToActiveState ¶
func (o *OutputContextMock) AddToActiveState(_ *vmcommon.VMOutput)
AddToActiveState mocked method
func (*OutputContextMock) AddTxValueToAccount ¶
func (o *OutputContextMock) AddTxValueToAccount(_ []byte, _ *big.Int)
AddTxValueToAccount mocked method
func (*OutputContextMock) CensorVMOutput ¶
func (o *OutputContextMock) CensorVMOutput()
CensorVMOutput mocked method
func (*OutputContextMock) ClearReturnData ¶
func (o *OutputContextMock) ClearReturnData()
ClearReturnData mocked method
func (*OutputContextMock) ClearStateStack ¶
func (o *OutputContextMock) ClearStateStack()
ClearStateStack mocked method
func (*OutputContextMock) CopyTopOfStackToActiveState ¶
func (o *OutputContextMock) CopyTopOfStackToActiveState()
CopyTopOfStackToActiveState mocked method
func (*OutputContextMock) CreateVMOutputInCaseOfError ¶
func (o *OutputContextMock) CreateVMOutputInCaseOfError(_ error) *vmcommon.VMOutput
CreateVMOutputInCaseOfError mocked method
func (*OutputContextMock) DeleteFirstReturnData ¶
func (o *OutputContextMock) DeleteFirstReturnData()
DeleteFirstReturnData mocked method
func (*OutputContextMock) DeleteOutputAccount ¶
func (o *OutputContextMock) DeleteOutputAccount(_ []byte)
DeleteOutputAccount mocked method
func (*OutputContextMock) DeployCode ¶
func (o *OutputContextMock) DeployCode(_ vmhost.CodeDeployInput)
DeployCode mocked method
func (*OutputContextMock) Finish ¶
func (o *OutputContextMock) Finish(data []byte)
Finish mocked method
func (*OutputContextMock) GetCrtTransferIndex ¶ added in v1.5.4
func (o *OutputContextMock) GetCrtTransferIndex() uint32
NextOutputTransferIndex mocked method
func (*OutputContextMock) GetCurrentTotalUsedGas ¶
func (o *OutputContextMock) GetCurrentTotalUsedGas() (uint64, bool)
GetCurrentTotalUsedGas mocked method
func (*OutputContextMock) GetOutputAccount ¶
func (o *OutputContextMock) GetOutputAccount(_ []byte) (*vmcommon.OutputAccount, bool)
GetOutputAccount mocked method
func (*OutputContextMock) GetOutputAccounts ¶
func (o *OutputContextMock) GetOutputAccounts() map[string]*vmcommon.OutputAccount
GetOutputAccounts mocked method
func (*OutputContextMock) GetRefund ¶
func (o *OutputContextMock) GetRefund() uint64
GetRefund mocked method
func (*OutputContextMock) GetVMOutput ¶
func (o *OutputContextMock) GetVMOutput() *vmcommon.VMOutput
GetVMOutput mocked method
func (*OutputContextMock) InitState ¶
func (o *OutputContextMock) InitState()
InitState mocked method
func (*OutputContextMock) IsInterfaceNil ¶ added in v1.5.4
func (o *OutputContextMock) IsInterfaceNil() bool
IsInterfaceNil mocked method
func (*OutputContextMock) NewVMOutputAccount ¶
func (o *OutputContextMock) NewVMOutputAccount(address []byte) *vmcommon.OutputAccount
NewVMOutputAccount mocked method
func (*OutputContextMock) NewVMOutputAccountFromMockAccount ¶
func (o *OutputContextMock) NewVMOutputAccountFromMockAccount(account *worldmock.Account) *vmcommon.OutputAccount
NewVMOutputAccountFromMockAccount mocked method
func (*OutputContextMock) NextOutputTransferIndex ¶ added in v1.5.4
func (o *OutputContextMock) NextOutputTransferIndex() uint32
NextOutputTransferIndex mocked method
func (*OutputContextMock) PopDiscard ¶
func (o *OutputContextMock) PopDiscard()
PopDiscard mocked method
func (*OutputContextMock) PopMergeActiveState ¶
func (o *OutputContextMock) PopMergeActiveState()
PopMergeActiveState mocked method
func (*OutputContextMock) PopSetActiveState ¶
func (o *OutputContextMock) PopSetActiveState()
PopSetActiveState mocked method
func (*OutputContextMock) PrependFinish ¶
func (o *OutputContextMock) PrependFinish(data []byte)
PrependFinish mocked method
func (*OutputContextMock) PushState ¶
func (o *OutputContextMock) PushState()
PushState mocked method
func (*OutputContextMock) RemoveNonUpdatedStorage ¶
func (o *OutputContextMock) RemoveNonUpdatedStorage()
RemoveNonUpdatedStorage mocked method
func (*OutputContextMock) RemoveReturnData ¶
func (o *OutputContextMock) RemoveReturnData(_ uint32)
RemoveReturnData mocked method
func (*OutputContextMock) ReturnCode ¶
func (o *OutputContextMock) ReturnCode() vmcommon.ReturnCode
ReturnCode mocked method
func (*OutputContextMock) ReturnData ¶
func (o *OutputContextMock) ReturnData() [][]byte
ReturnData mocked method
func (*OutputContextMock) ReturnMessage ¶
func (o *OutputContextMock) ReturnMessage() string
ReturnMessage mocked method
func (*OutputContextMock) SetCrtTransferIndex ¶ added in v1.5.4
func (o *OutputContextMock) SetCrtTransferIndex(index uint32)
NextOutputTransferIndex mocked method
func (*OutputContextMock) SetRefund ¶
func (o *OutputContextMock) SetRefund(refund uint64)
SetRefund mocked method
func (*OutputContextMock) SetReturnCode ¶
func (o *OutputContextMock) SetReturnCode(returnCode vmcommon.ReturnCode)
SetReturnCode mocked method
func (*OutputContextMock) SetReturnMessage ¶
func (o *OutputContextMock) SetReturnMessage(returnMessage string)
SetReturnMessage mocked method
func (*OutputContextMock) Transfer ¶
func (o *OutputContextMock) Transfer(_ []byte, _ []byte, _ uint64, _ uint64, _ *big.Int, _ []byte, _ []byte, _ vm.CallType) error
Transfer mocked method
func (*OutputContextMock) TransferESDT ¶
func (o *OutputContextMock) TransferESDT(_ *vmhost.ESDTTransfersArgs, _ *vmcommon.ContractCallInput) (uint64, error)
TransferESDT mocked method
func (*OutputContextMock) TransferValueOnly ¶
TransferValueOnly mocked method
func (*OutputContextMock) WriteLog ¶
func (o *OutputContextMock) WriteLog(_ []byte, _ [][]byte, _ [][]byte)
WriteLog mocked method
func (*OutputContextMock) WriteLogWithIdentifier ¶ added in v1.5.9
func (o *OutputContextMock) WriteLogWithIdentifier(_ []byte, _ [][]byte, _ [][]byte, _ []byte)
WriteLogWithIdentifier mocked method
type OutputContextStub ¶
type OutputContextStub struct { InitStateCalled func() PushStateCalled func() PopSetActiveStateCalled func() PopMergeActiveStateCalled func() PopDiscardCalled func() ClearStateStackCalled func() CopyTopOfStackToActiveStateCalled func() CensorVMOutputCalled func() GetOutputAccountsCalled func() map[string]*vmcommon.OutputAccount GetOutputAccountCalled func(address []byte) (*vmcommon.OutputAccount, bool) DeleteOutputAccountCalled func(address []byte) WriteLogCalled func(address []byte, topics [][]byte, data [][]byte) WriteLogWithIdentifierCalled func(address []byte, topics [][]byte, data [][]byte, identifier []byte) TransferCalled func(destination []byte, sender []byte, gasLimit uint64, gasLocked uint64, value *big.Int, asyncData []byte, input []byte) error TransferESDTCalled func(transfersArgs *vmhost.ESDTTransfersArgs, input *vmcommon.ContractCallInput) (uint64, error) 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() RemoveReturnDataCalled func(index uint32) FinishCalled func(data []byte) PrependFinishCalled func(data []byte) DeleteFirstReturnDataCalled func() GetVMOutputCalled func() *vmcommon.VMOutput AddTxValueToAccountCalled func(address []byte, value *big.Int) DeployCodeCalled func(input vmhost.CodeDeployInput) CreateVMOutputInCaseOfErrorCalled func(err error) *vmcommon.VMOutput AddToActiveStateCalled func(vmOutput *vmcommon.VMOutput) TransferValueOnlyCalled func(destination []byte, sender []byte, value *big.Int, checkPayable bool) error RemoveNonUpdatedStorageCalled func() NextOutputTransferIndexCalled func() uint32 GetCrtTransferIndexCalled func() uint32 SetCrtTransferIndexCalled func(index uint32) IsInterfaceNilCalled func() bool }
OutputContextStub is used in tests to check the OutputContext interface method calls
func (*OutputContextStub) AddToActiveState ¶
func (o *OutputContextStub) AddToActiveState(vmOutput *vmcommon.VMOutput)
AddToActiveState mocked method
func (*OutputContextStub) AddTxValueToAccount ¶
func (o *OutputContextStub) AddTxValueToAccount(address []byte, value *big.Int)
AddTxValueToAccount mocked method
func (*OutputContextStub) CensorVMOutput ¶
func (o *OutputContextStub) CensorVMOutput()
CensorVMOutput mocked method
func (*OutputContextStub) ClearReturnData ¶
func (o *OutputContextStub) ClearReturnData()
ClearReturnData mocked method
func (*OutputContextStub) ClearStateStack ¶
func (o *OutputContextStub) ClearStateStack()
ClearStateStack mocked method
func (*OutputContextStub) CopyTopOfStackToActiveState ¶
func (o *OutputContextStub) CopyTopOfStackToActiveState()
CopyTopOfStackToActiveState mocked method
func (*OutputContextStub) CreateVMOutputInCaseOfError ¶
func (o *OutputContextStub) CreateVMOutputInCaseOfError(err error) *vmcommon.VMOutput
CreateVMOutputInCaseOfError mocked method
func (*OutputContextStub) DeleteFirstReturnData ¶
func (o *OutputContextStub) DeleteFirstReturnData()
DeleteFirstReturnData mocked method
func (*OutputContextStub) DeleteOutputAccount ¶
func (o *OutputContextStub) DeleteOutputAccount(address []byte)
DeleteOutputAccount mocked method
func (*OutputContextStub) DeployCode ¶
func (o *OutputContextStub) DeployCode(input vmhost.CodeDeployInput)
DeployCode mocked method
func (*OutputContextStub) Finish ¶
func (o *OutputContextStub) Finish(data []byte)
Finish mocked method
func (*OutputContextStub) GetCrtTransferIndex ¶ added in v1.5.4
func (o *OutputContextStub) GetCrtTransferIndex() uint32
GetCrtTransferIndex mocked method
func (*OutputContextStub) GetOutputAccount ¶
func (o *OutputContextStub) GetOutputAccount(address []byte) (*vmcommon.OutputAccount, bool)
GetOutputAccount mocked method
func (*OutputContextStub) GetOutputAccounts ¶
func (o *OutputContextStub) GetOutputAccounts() map[string]*vmcommon.OutputAccount
GetOutputAccounts mocked method
func (*OutputContextStub) GetRefund ¶
func (o *OutputContextStub) GetRefund() uint64
GetRefund mocked method
func (*OutputContextStub) GetVMOutput ¶
func (o *OutputContextStub) GetVMOutput() *vmcommon.VMOutput
GetVMOutput mocked method
func (*OutputContextStub) InitState ¶
func (o *OutputContextStub) InitState()
InitState mocked method
func (*OutputContextStub) IsInterfaceNil ¶ added in v1.5.4
func (o *OutputContextStub) IsInterfaceNil() bool
IsInterfaceNil mocked method
func (*OutputContextStub) NextOutputTransferIndex ¶ added in v1.5.4
func (o *OutputContextStub) NextOutputTransferIndex() uint32
NextOutputTransferIndex mocked method
func (*OutputContextStub) PopDiscard ¶
func (o *OutputContextStub) PopDiscard()
PopDiscard mocked method
func (*OutputContextStub) PopMergeActiveState ¶
func (o *OutputContextStub) PopMergeActiveState()
PopMergeActiveState mocked method
func (*OutputContextStub) PopSetActiveState ¶
func (o *OutputContextStub) PopSetActiveState()
PopSetActiveState mocked method
func (*OutputContextStub) PrependFinish ¶
func (o *OutputContextStub) PrependFinish(data []byte)
PrependFinish mocked method
func (*OutputContextStub) PushState ¶
func (o *OutputContextStub) PushState()
PushState mocked method
func (*OutputContextStub) RemoveNonUpdatedStorage ¶
func (o *OutputContextStub) RemoveNonUpdatedStorage()
RemoveNonUpdatedStorage mocked method
func (*OutputContextStub) RemoveReturnData ¶
func (o *OutputContextStub) RemoveReturnData(index uint32)
RemoveReturnData mocked method
func (*OutputContextStub) ReturnCode ¶
func (o *OutputContextStub) ReturnCode() vmcommon.ReturnCode
ReturnCode mocked method
func (*OutputContextStub) ReturnData ¶
func (o *OutputContextStub) ReturnData() [][]byte
ReturnData mocked method
func (*OutputContextStub) ReturnMessage ¶
func (o *OutputContextStub) ReturnMessage() string
ReturnMessage mocked method
func (*OutputContextStub) SetCrtTransferIndex ¶ added in v1.5.4
func (o *OutputContextStub) SetCrtTransferIndex(index uint32)
SetCrtTransferIndex mocked method
func (*OutputContextStub) SetRefund ¶
func (o *OutputContextStub) SetRefund(refund uint64)
SetRefund mocked method
func (*OutputContextStub) SetReturnCode ¶
func (o *OutputContextStub) SetReturnCode(returnCode vmcommon.ReturnCode)
SetReturnCode mocked method
func (*OutputContextStub) SetReturnMessage ¶
func (o *OutputContextStub) SetReturnMessage(message string)
SetReturnMessage mocked method
func (*OutputContextStub) Transfer ¶
func (o *OutputContextStub) Transfer(destination []byte, sender []byte, gasLimit uint64, gasLocked uint64, value *big.Int, asyncData []byte, input []byte, _ vm.CallType) error
Transfer mocked method
func (*OutputContextStub) TransferESDT ¶
func (o *OutputContextStub) TransferESDT(transfersArgs *vmhost.ESDTTransfersArgs, callInput *vmcommon.ContractCallInput) (uint64, error)
TransferESDT mocked method
func (*OutputContextStub) TransferValueOnly ¶
func (o *OutputContextStub) TransferValueOnly(destination []byte, sender []byte, value *big.Int, checkPayable bool) error
TransferValueOnly mocked method
func (*OutputContextStub) WriteLog ¶
func (o *OutputContextStub) WriteLog(address []byte, topics [][]byte, data [][]byte)
WriteLog mocked method
func (*OutputContextStub) WriteLogWithIdentifier ¶ added in v1.5.9
func (o *OutputContextStub) WriteLogWithIdentifier(address []byte, topics [][]byte, data [][]byte, identifier []byte)
WriteLogWithIdentifier mocked method
type RuntimeContextMock ¶
type RuntimeContextMock struct { Err error VMInput *vmcommon.ContractCallInput OriginalCallerAddr []byte SCAddress []byte SCCode []byte SCCodeSize uint64 CallFunction string VMType []byte ReadOnlyFlag bool VerifyCode bool CurrentBreakpointValue vmhost.BreakpointValue PointsUsed uint64 InstanceCtxID int MemLoadResult []byte MemLoadMultipleResult [][]byte FailCryptoAPI bool FailBaseOpsAPI bool FailSyncExecAPI bool FailBigIntAPI bool FailBigFloatAPI bool FailManagedBuffersAPI bool FailManagedMapAPI bool AsyncCallInfo *vmhost.AsyncCallInfo InstanceStackSize uint64 CurrentTxHash []byte OriginalTxHash []byte TraceGasEnabled bool GasTrace map[string]map[string][]uint64 SameContractOnStackCount uint64 HasFunctionResult bool }
RuntimeContextMock is used in tests to check the RuntimeContextMock interface method calls
func (*RuntimeContextMock) AddAsyncContextCall ¶
func (r *RuntimeContextMock) AddAsyncContextCall(_ []byte, _ *vmhost.AsyncGeneratedCall) error
AddAsyncContextCall mocked method
func (*RuntimeContextMock) AddError ¶
func (r *RuntimeContextMock) AddError(_ error, _ ...string)
AddError mocked method
func (*RuntimeContextMock) Arguments ¶
func (r *RuntimeContextMock) Arguments() [][]byte
Arguments mocked method
func (*RuntimeContextMock) BaseOpsErrorShouldFailExecution ¶
func (r *RuntimeContextMock) BaseOpsErrorShouldFailExecution() bool
BaseOpsErrorShouldFailExecution mocked method
func (*RuntimeContextMock) BigFloatAPIErrorShouldFailExecution ¶
func (r *RuntimeContextMock) BigFloatAPIErrorShouldFailExecution() bool
BigFloatAPIErrorShouldFailExecution mocked method
func (*RuntimeContextMock) BigIntAPIErrorShouldFailExecution ¶
func (r *RuntimeContextMock) BigIntAPIErrorShouldFailExecution() bool
BigIntAPIErrorShouldFailExecution mocked method
func (*RuntimeContextMock) CallSCFunction ¶
func (r *RuntimeContextMock) CallSCFunction(_ string) error
CallSCFunction mocked method
func (*RuntimeContextMock) CleanInstance ¶
func (r *RuntimeContextMock) CleanInstance()
CleanInstance mocked method
func (*RuntimeContextMock) ClearInstanceStack ¶
func (r *RuntimeContextMock) ClearInstanceStack()
ClearInstanceStack mocked method
func (*RuntimeContextMock) ClearStateStack ¶
func (r *RuntimeContextMock) ClearStateStack()
ClearStateStack mocked method
func (*RuntimeContextMock) ClearWarmInstanceCache ¶
func (r *RuntimeContextMock) ClearWarmInstanceCache()
ClearWarmInstanceCache mocked method
func (*RuntimeContextMock) CountSameContractInstancesOnStack ¶
func (r *RuntimeContextMock) CountSameContractInstancesOnStack(_ []byte) uint64
CountSameContractInstancesOnStack mocked method
func (*RuntimeContextMock) CryptoAPIErrorShouldFailExecution ¶
func (r *RuntimeContextMock) CryptoAPIErrorShouldFailExecution() bool
CryptoAPIErrorShouldFailExecution mocked method
func (*RuntimeContextMock) EndExecution ¶
func (r *RuntimeContextMock) EndExecution()
EndExecution -
func (*RuntimeContextMock) ExtractCodeUpgradeFromArgs ¶
func (r *RuntimeContextMock) ExtractCodeUpgradeFromArgs() ([]byte, []byte, error)
ExtractCodeUpgradeFromArgs mocked method
func (*RuntimeContextMock) FailExecution ¶
func (r *RuntimeContextMock) FailExecution(_ error)
FailExecution mocked method
func (*RuntimeContextMock) FunctionName ¶
func (r *RuntimeContextMock) FunctionName() string
FunctionName mocked method
func (*RuntimeContextMock) FunctionNameChecked ¶
func (r *RuntimeContextMock) FunctionNameChecked() (string, error)
FunctionNameChecked mocked method
func (*RuntimeContextMock) GetAllErrors ¶
func (r *RuntimeContextMock) GetAllErrors() error
GetAllErrors mocked method
func (*RuntimeContextMock) GetContextAddress ¶
func (r *RuntimeContextMock) GetContextAddress() []byte
GetContextAddress mocked method
func (*RuntimeContextMock) GetCurrentTxHash ¶
func (r *RuntimeContextMock) GetCurrentTxHash() []byte
GetCurrentTxHash mocked method
func (*RuntimeContextMock) GetInstance ¶
func (r *RuntimeContextMock) GetInstance() executor.Instance
GetInstance mocked method()
func (*RuntimeContextMock) GetInstanceStackSize ¶
func (r *RuntimeContextMock) GetInstanceStackSize() uint64
GetInstanceStackSize mocked method
func (*RuntimeContextMock) GetInstanceTracker ¶
func (context *RuntimeContextMock) GetInstanceTracker() vmhost.InstanceTracker
GetInstanceTracker mocked method
func (*RuntimeContextMock) GetOriginalCallerAddress ¶
func (r *RuntimeContextMock) GetOriginalCallerAddress() []byte
GetOriginalCallerAddress mocked method
func (*RuntimeContextMock) GetOriginalTxHash ¶
func (r *RuntimeContextMock) GetOriginalTxHash() []byte
GetOriginalTxHash mocked method
func (*RuntimeContextMock) GetPointsUsed ¶
func (r *RuntimeContextMock) GetPointsUsed() uint64
GetPointsUsed mocked method
func (*RuntimeContextMock) GetPrevTxHash ¶
func (r *RuntimeContextMock) GetPrevTxHash() []byte
GetPrevTxHash mocked method
func (*RuntimeContextMock) GetRuntimeBreakpointValue ¶
func (r *RuntimeContextMock) GetRuntimeBreakpointValue() vmhost.BreakpointValue
GetRuntimeBreakpointValue mocked method
func (*RuntimeContextMock) GetSCCode ¶
func (r *RuntimeContextMock) GetSCCode() ([]byte, error)
GetSCCode mocked method
func (*RuntimeContextMock) GetSCCodeSize ¶
func (r *RuntimeContextMock) GetSCCodeSize() uint64
GetSCCodeSize mocked method
func (*RuntimeContextMock) GetVMExecutor ¶
func (r *RuntimeContextMock) GetVMExecutor() executor.Executor
GetVMExecutor mocked method
func (*RuntimeContextMock) GetVMInput ¶
func (r *RuntimeContextMock) GetVMInput() *vmcommon.ContractCallInput
GetVMInput mocked method
func (*RuntimeContextMock) GetVMType ¶
func (r *RuntimeContextMock) GetVMType() []byte
GetVMType mocked method
func (*RuntimeContextMock) GetWarmInstance ¶
func (r *RuntimeContextMock) GetWarmInstance(codeHash []byte) (executor.Instance, bool)
GetWarmInstance mocked method
func (*RuntimeContextMock) HasFunction ¶
func (r *RuntimeContextMock) HasFunction(_ string) bool
HasFunction mocked method
func (*RuntimeContextMock) InitState ¶
func (r *RuntimeContextMock) InitState()
InitState mocked method
func (*RuntimeContextMock) InitStateFromContractCallInput ¶
func (r *RuntimeContextMock) InitStateFromContractCallInput(_ *vmcommon.ContractCallInput)
InitStateFromContractCallInput mocked method
func (*RuntimeContextMock) IsFunctionImported ¶
func (r *RuntimeContextMock) IsFunctionImported(_ string) bool
IsFunctionImported mocked method
func (*RuntimeContextMock) IsWarmInstance ¶
func (r *RuntimeContextMock) IsWarmInstance() bool
IsWarmInstance mocked method
func (*RuntimeContextMock) ManagedBufferAPIErrorShouldFailExecution ¶
func (r *RuntimeContextMock) ManagedBufferAPIErrorShouldFailExecution() bool
ManagedBufferAPIErrorShouldFailExecution mocked method
func (*RuntimeContextMock) ManagedMapAPIErrorShouldFailExecution ¶
func (r *RuntimeContextMock) ManagedMapAPIErrorShouldFailExecution() bool
ManagedMapAPIErrorShouldFailExecution mocked method
func (*RuntimeContextMock) MustVerifyNextContractCode ¶
func (r *RuntimeContextMock) MustVerifyNextContractCode()
MustVerifyNextContractCode mocked method
func (*RuntimeContextMock) NumRunningInstances ¶
func (r *RuntimeContextMock) NumRunningInstances() (int, int)
NumRunningInstances mocked method
func (*RuntimeContextMock) PopDiscard ¶
func (r *RuntimeContextMock) PopDiscard()
PopDiscard mocked method
func (*RuntimeContextMock) PopInstance ¶
func (r *RuntimeContextMock) PopInstance()
PopInstance mocked method
func (*RuntimeContextMock) PopSetActiveState ¶
func (r *RuntimeContextMock) PopSetActiveState()
PopSetActiveState mocked method
func (*RuntimeContextMock) PrepareLegacyAsyncCall ¶
func (r *RuntimeContextMock) PrepareLegacyAsyncCall(_ []byte, _ []byte, _ []byte) error
PrepareLegacyAsyncCall mocked method
func (*RuntimeContextMock) PushInstance ¶
func (r *RuntimeContextMock) PushInstance()
PushInstance mocked method
func (*RuntimeContextMock) PushState ¶
func (r *RuntimeContextMock) PushState()
PushState mocked method
func (*RuntimeContextMock) ReadOnly ¶
func (r *RuntimeContextMock) ReadOnly() bool
ReadOnly mocked method
func (*RuntimeContextMock) ReplaceVMExecutor ¶
func (context *RuntimeContextMock) ReplaceVMExecutor(vmExecutor executor.Executor)
ReplaceVMExecutor mocked method
func (*RuntimeContextMock) ResetWarmInstance ¶
func (r *RuntimeContextMock) ResetWarmInstance()
ResetWarmInstance mocked method
func (*RuntimeContextMock) SetCaching ¶
func (r *RuntimeContextMock) SetCaching(_ bool)
SetCaching mocked method
func (*RuntimeContextMock) SetCodeAddress ¶
func (r *RuntimeContextMock) SetCodeAddress(scAddress []byte)
SetCodeAddress mocked method
func (*RuntimeContextMock) SetCustomCallFunction ¶
func (r *RuntimeContextMock) SetCustomCallFunction(_ string)
SetCustomCallFunction mocked method
func (*RuntimeContextMock) SetMaxInstanceStackSize ¶
func (r *RuntimeContextMock) SetMaxInstanceStackSize(uint64)
SetMaxInstanceStackSize mocked method
func (*RuntimeContextMock) SetOriginalCallerAddress ¶
func (r *RuntimeContextMock) SetOriginalCallerAddress(scAddress []byte)
SetOriginalCallerAddress mocked method
func (*RuntimeContextMock) SetPointsUsed ¶
func (r *RuntimeContextMock) SetPointsUsed(gasPoints uint64)
SetPointsUsed mocked method
func (*RuntimeContextMock) SetReadOnly ¶
func (r *RuntimeContextMock) SetReadOnly(readOnly bool)
SetReadOnly mocked method
func (*RuntimeContextMock) SetRuntimeBreakpointValue ¶
func (r *RuntimeContextMock) SetRuntimeBreakpointValue(_ vmhost.BreakpointValue)
SetRuntimeBreakpointValue mocked method
func (*RuntimeContextMock) SetVMInput ¶
func (r *RuntimeContextMock) SetVMInput(vmInput *vmcommon.ContractCallInput)
SetVMInput mocked method
func (*RuntimeContextMock) SignalExit ¶
func (r *RuntimeContextMock) SignalExit(_ int)
SignalExit mocked method
func (*RuntimeContextMock) SignalUserError ¶
func (r *RuntimeContextMock) SignalUserError(_ string)
SignalUserError mocked method
func (*RuntimeContextMock) StartWasmerInstance ¶
func (r *RuntimeContextMock) StartWasmerInstance(_ []byte, _ uint64, _ bool) error
StartWasmerInstance mocked method
func (*RuntimeContextMock) SyncExecAPIErrorShouldFailExecution ¶
func (r *RuntimeContextMock) SyncExecAPIErrorShouldFailExecution() bool
SyncExecAPIErrorShouldFailExecution mocked method
func (*RuntimeContextMock) ValidateCallbackName ¶
func (r *RuntimeContextMock) ValidateCallbackName(_ string) error
ValidateCallbackName mocked method
func (*RuntimeContextMock) ValidateInstances ¶
func (r *RuntimeContextMock) ValidateInstances() error
ValidateInstances -
func (*RuntimeContextMock) VerifyContractCode ¶
func (r *RuntimeContextMock) VerifyContractCode() error
VerifyContractCode mocked method
type RuntimeContextWrapper ¶
type RuntimeContextWrapper struct { // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) InitStateFromContractCallInputFunc func(input *vmcommon.ContractCallInput) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) SetCustomCallFunctionFunc func(callFunction string) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetVMInputFunc func() *vmcommon.ContractCallInput // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) SetVMInputFunc func(vmInput *vmcommon.ContractCallInput) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetSCAddressFunc func() []byte // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetOriginalCallerAddressFunc func() []byte // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) SetCodeAddressFunc func(scAddress []byte) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetSCCodeFunc func() ([]byte, error) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetSCCodeSizeFunc func() uint64 // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetVMTypeFunc func() []byte // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) FunctionFunc func() string // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) ArgumentsFunc func() [][]byte // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetCurrentTxHashFunc func() []byte // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetOriginalTxHashFunc func() []byte // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) ExtractCodeUpgradeFromArgsFunc func() ([]byte, []byte, error) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) SignalUserErrorFunc func(message string) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) FailExecutionFunc func(err error) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) MustVerifyNextContractCodeFunc func() // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) SetRuntimeBreakpointValueFunc func(value vmhost.BreakpointValue) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetRuntimeBreakpointValueFunc func() vmhost.BreakpointValue // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetAsyncCallInfoFunc func() *vmhost.AsyncCallInfo // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) SetAsyncCallInfoFunc func(asyncCallInfo *vmhost.AsyncCallInfo) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) AddAsyncContextCallFunc func(contextIdentifier []byte, asyncCall *vmhost.AsyncGeneratedCall) error // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetAsyncContextFunc func(contextIdentifier []byte) (*vmhost.AsyncContext, error) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetInstanceStackSizeFunc func() uint64 // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) CountSameContractInstancesOnStackFunc func(address []byte) uint64 // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) IsFunctionImportedFunc func(name string) bool // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) ReadOnlyFunc func() bool // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) SetReadOnlyFunc func(readOnly bool) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) StartWasmerInstanceFunc func(contract []byte, gasLimit uint64, newCode bool) error // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) ClearWarmInstanceCacheFunc func() // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) SetMaxInstanceStackSizeFunc func(maxInstanceStackSize uint64) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) VerifyContractCodeFunc func() error // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetInstanceFunc func() executor.Instance // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) FunctionNameCheckedFunc func() (string, error) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) CallSCFunctionFunc func(string) error // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetPointsUsedFunc func() uint64 // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) SetPointsUsedFunc func(gasPoints uint64) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) BaseOpsErrorShouldFailExecutionFunc func() bool // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) SyncExecAPIErrorShouldFailExecutionFunc func() bool // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) CryptoAPIErrorShouldFailExecutionFunc func() bool // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) BigIntAPIErrorShouldFailExecutionFunc func() bool // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) BigFloatAPIErrorShouldFailExecutionFunc func() bool // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) ManagedBufferAPIErrorShouldFailExecutionFunc func() bool // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetVMExecutorFunc func() executor.Executor // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) AddErrorFunc func(err error, otherInfo ...string) // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetAllErrorsFunc func() error // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) InitStateFunc func() // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) PushStateFunc func() // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) PopSetActiveStateFunc func() // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) PopDiscardFunc func() // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) ClearStateStackFunc func() // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) CleanInstanceFunc func() // function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function) GetInstanceTrackerFunc func() vmhost.InstanceTracker // contains filtered or unexported fields }
RuntimeContextWrapper a wrapper over a RuntimeContext that delegates to if if function is not redefined
func NewRuntimeContextWrapper ¶
func NewRuntimeContextWrapper(inputRuntimeContext *vmhost.RuntimeContext) *RuntimeContextWrapper
NewRuntimeContextWrapper builds a new runtimeContextWrapper that by default will delagate all calls to the provided RuntimeContext
func (*RuntimeContextWrapper) AddError ¶
func (contextWrapper *RuntimeContextWrapper) AddError(err error, otherInfo ...string)
AddError calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) Arguments ¶
func (contextWrapper *RuntimeContextWrapper) Arguments() [][]byte
Arguments calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) BaseOpsErrorShouldFailExecution ¶
func (contextWrapper *RuntimeContextWrapper) BaseOpsErrorShouldFailExecution() bool
BaseOpsErrorShouldFailExecution calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) BigFloatAPIErrorShouldFailExecution ¶
func (contextWrapper *RuntimeContextWrapper) BigFloatAPIErrorShouldFailExecution() bool
BigFloatAPIErrorShouldFailExecution calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) BigIntAPIErrorShouldFailExecution ¶
func (contextWrapper *RuntimeContextWrapper) BigIntAPIErrorShouldFailExecution() bool
BigIntAPIErrorShouldFailExecution calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) CallSCFunction ¶
func (contextWrapper *RuntimeContextWrapper) CallSCFunction(functionName string) error
CallSCFunction calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) CleanInstance ¶
func (contextWrapper *RuntimeContextWrapper) CleanInstance()
CleanInstance calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) ClearStateStack ¶
func (contextWrapper *RuntimeContextWrapper) ClearStateStack()
ClearStateStack calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) ClearWarmInstanceCache ¶
func (contextWrapper *RuntimeContextWrapper) ClearWarmInstanceCache()
ClearWarmInstanceCache calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) CountSameContractInstancesOnStack ¶
func (contextWrapper *RuntimeContextWrapper) CountSameContractInstancesOnStack(address []byte) uint64
CountSameContractInstancesOnStack calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) CryptoAPIErrorShouldFailExecution ¶
func (contextWrapper *RuntimeContextWrapper) CryptoAPIErrorShouldFailExecution() bool
CryptoAPIErrorShouldFailExecution calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) EndExecution ¶
func (contextWrapper *RuntimeContextWrapper) EndExecution()
EndExecution -
func (*RuntimeContextWrapper) ExtractCodeUpgradeFromArgs ¶
func (contextWrapper *RuntimeContextWrapper) ExtractCodeUpgradeFromArgs() ([]byte, []byte, error)
ExtractCodeUpgradeFromArgs calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) FailExecution ¶
func (contextWrapper *RuntimeContextWrapper) FailExecution(err error)
FailExecution calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) FunctionName ¶
func (contextWrapper *RuntimeContextWrapper) FunctionName() string
FunctionName calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) FunctionNameChecked ¶
func (contextWrapper *RuntimeContextWrapper) FunctionNameChecked() (string, error)
FunctionNameChecked calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetAllErrors ¶
func (contextWrapper *RuntimeContextWrapper) GetAllErrors() error
GetAllErrors calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetContextAddress ¶
func (contextWrapper *RuntimeContextWrapper) GetContextAddress() []byte
GetContextAddress calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetCurrentTxHash ¶
func (contextWrapper *RuntimeContextWrapper) GetCurrentTxHash() []byte
GetCurrentTxHash calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetInstance ¶
func (contextWrapper *RuntimeContextWrapper) GetInstance() executor.Instance
GetInstance calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetInstanceStackSize ¶
func (contextWrapper *RuntimeContextWrapper) GetInstanceStackSize() uint64
GetInstanceStackSize calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetInstanceTracker ¶
func (contextWrapper *RuntimeContextWrapper) GetInstanceTracker() vmhost.InstanceTracker
GetInstanceTracker -
func (*RuntimeContextWrapper) GetOriginalCallerAddress ¶
func (contextWrapper *RuntimeContextWrapper) GetOriginalCallerAddress() []byte
GetOriginalCallerAddress calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetOriginalTxHash ¶
func (contextWrapper *RuntimeContextWrapper) GetOriginalTxHash() []byte
GetOriginalTxHash calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetPointsUsed ¶
func (contextWrapper *RuntimeContextWrapper) GetPointsUsed() uint64
GetPointsUsed calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetPrevTxHash ¶
func (contextWrapper *RuntimeContextWrapper) GetPrevTxHash() []byte
GetPrevTxHash calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetRuntimeBreakpointValue ¶
func (contextWrapper *RuntimeContextWrapper) GetRuntimeBreakpointValue() vmhost.BreakpointValue
GetRuntimeBreakpointValue calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetSCCode ¶
func (contextWrapper *RuntimeContextWrapper) GetSCCode() ([]byte, error)
GetSCCode calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetSCCodeSize ¶
func (contextWrapper *RuntimeContextWrapper) GetSCCodeSize() uint64
GetSCCodeSize calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetVMExecutor ¶
func (contextWrapper *RuntimeContextWrapper) GetVMExecutor() executor.Executor
GetVMExecutor calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetVMInput ¶
func (contextWrapper *RuntimeContextWrapper) GetVMInput() *vmcommon.ContractCallInput
GetVMInput calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetVMType ¶
func (contextWrapper *RuntimeContextWrapper) GetVMType() []byte
GetVMType calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) GetWrappedRuntimeContext ¶
func (contextWrapper *RuntimeContextWrapper) GetWrappedRuntimeContext() vmhost.RuntimeContext
GetWrappedRuntimeContext gets the wrapped RuntimeContext
func (*RuntimeContextWrapper) HasFunction ¶
func (contextWrapper *RuntimeContextWrapper) HasFunction(functionName string) bool
HasFunction calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) InitState ¶
func (contextWrapper *RuntimeContextWrapper) InitState()
InitState calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) InitStateFromContractCallInput ¶
func (contextWrapper *RuntimeContextWrapper) InitStateFromContractCallInput(input *vmcommon.ContractCallInput)
InitStateFromContractCallInput calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) IsFunctionImported ¶
func (contextWrapper *RuntimeContextWrapper) IsFunctionImported(name string) bool
IsFunctionImported calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) ManagedBufferAPIErrorShouldFailExecution ¶
func (contextWrapper *RuntimeContextWrapper) ManagedBufferAPIErrorShouldFailExecution() bool
ManagedBufferAPIErrorShouldFailExecution calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) ManagedMapAPIErrorShouldFailExecution ¶
func (contextWrapper *RuntimeContextWrapper) ManagedMapAPIErrorShouldFailExecution() bool
ManagedMapAPIErrorShouldFailExecution calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) MustVerifyNextContractCode ¶
func (contextWrapper *RuntimeContextWrapper) MustVerifyNextContractCode()
MustVerifyNextContractCode calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) PopDiscard ¶
func (contextWrapper *RuntimeContextWrapper) PopDiscard()
PopDiscard calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) PopSetActiveState ¶
func (contextWrapper *RuntimeContextWrapper) PopSetActiveState()
PopSetActiveState calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) PushState ¶
func (contextWrapper *RuntimeContextWrapper) PushState()
PushState calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) ReadOnly ¶
func (contextWrapper *RuntimeContextWrapper) ReadOnly() bool
ReadOnly calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) ReplaceVMExecutor ¶
func (contextWrapper *RuntimeContextWrapper) ReplaceVMExecutor(vmExecutor executor.Executor)
ReplaceVMExecutor mocked method
func (*RuntimeContextWrapper) SetCodeAddress ¶
func (contextWrapper *RuntimeContextWrapper) SetCodeAddress(scAddress []byte)
SetCodeAddress calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) SetCustomCallFunction ¶
func (contextWrapper *RuntimeContextWrapper) SetCustomCallFunction(callFunction string)
SetCustomCallFunction calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) SetMaxInstanceStackSize ¶
func (contextWrapper *RuntimeContextWrapper) SetMaxInstanceStackSize(maxInstanceStackSize uint64)
SetMaxInstanceStackSize calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) SetPointsUsed ¶
func (contextWrapper *RuntimeContextWrapper) SetPointsUsed(gasPoints uint64)
SetPointsUsed calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) SetReadOnly ¶
func (contextWrapper *RuntimeContextWrapper) SetReadOnly(readOnly bool)
SetReadOnly calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) SetRuntimeBreakpointValue ¶
func (contextWrapper *RuntimeContextWrapper) SetRuntimeBreakpointValue(value vmhost.BreakpointValue)
SetRuntimeBreakpointValue calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) SetVMInput ¶
func (contextWrapper *RuntimeContextWrapper) SetVMInput(vmInput *vmcommon.ContractCallInput)
SetVMInput calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) SignalUserError ¶
func (contextWrapper *RuntimeContextWrapper) SignalUserError(message string)
SignalUserError calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) StartWasmerInstance ¶
func (contextWrapper *RuntimeContextWrapper) StartWasmerInstance(contract []byte, gasLimit uint64, newCode bool) error
StartWasmerInstance calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) SyncExecAPIErrorShouldFailExecution ¶
func (contextWrapper *RuntimeContextWrapper) SyncExecAPIErrorShouldFailExecution() bool
SyncExecAPIErrorShouldFailExecution calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) ValidateCallbackName ¶
func (contextWrapper *RuntimeContextWrapper) ValidateCallbackName(callbackName string) error
ValidateCallbackName calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (*RuntimeContextWrapper) ValidateInstances ¶
func (contextWrapper *RuntimeContextWrapper) ValidateInstances() error
ValidateInstances -
func (*RuntimeContextWrapper) VerifyContractCode ¶
func (contextWrapper *RuntimeContextWrapper) VerifyContractCode() error
VerifyContractCode calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
type StubAccount ¶
type StubAccount struct { Address []byte Nonce uint64 Balance *big.Int CodeHash []byte CodeMetadata []byte OwnerAddress []byte UserName []byte ShardID uint32 Storage map[string][]byte Err error }
StubAccount is used with the blockchain stub in vm context tests. It has minimal functionality.
func (*StubAccount) AccountDataHandler ¶
func (a *StubAccount) AccountDataHandler() vmcommon.AccountDataHandler
AccountDataHandler -
func (*StubAccount) AddToBalance ¶
func (a *StubAccount) AddToBalance(_ *big.Int) error
AddToBalance -
func (*StubAccount) ChangeOwnerAddress ¶
func (a *StubAccount) ChangeOwnerAddress(_ []byte, _ []byte) error
ChangeOwnerAddress -
func (*StubAccount) ClaimDeveloperRewards ¶
func (a *StubAccount) ClaimDeveloperRewards(_ []byte) (*big.Int, error)
ClaimDeveloperRewards -
func (*StubAccount) GetCodeMetadata ¶
func (a *StubAccount) GetCodeMetadata() []byte
GetCodeMetadata -
func (*StubAccount) GetDeveloperReward ¶
func (a *StubAccount) GetDeveloperReward() *big.Int
GetDeveloperReward -
func (*StubAccount) GetOwnerAddress ¶
func (a *StubAccount) GetOwnerAddress() []byte
GetOwnerAddress -
func (*StubAccount) SetCodeMetadata ¶ added in v1.5.4
func (a *StubAccount) SetCodeMetadata(_ []byte)
SetCodeMetadata -
func (*StubAccount) SetOwnerAddress ¶
func (a *StubAccount) SetOwnerAddress(_ []byte)
SetOwnerAddress -
type VMHostMock ¶
type VMHostMock struct { BlockChainHook vmcommon.BlockchainHook CryptoHook crypto.VMCrypto EthInput []byte BlockchainContext vmhost.BlockchainContext RuntimeContext vmhost.RuntimeContext AsyncContext vmhost.AsyncContext OutputContext vmhost.OutputContext MeteringContext vmhost.MeteringContext StorageContext vmhost.StorageContext EnableEpochsHandlerField vmhost.EnableEpochsHandler ManagedTypesContext vmhost.ManagedTypesContext IsBuiltinFunc bool StoredInputs []*vmcommon.ContractCallInput VMOutputQueue []*vmcommon.VMOutput VMOutputToReturn int Err error }
VMHostMock is used in tests to check the VMHost interface method calls
func (*VMHostMock) AreInSameShard ¶
func (host *VMHostMock) AreInSameShard(left []byte, right []byte) bool
AreInSameShard mocked method
func (*VMHostMock) Blockchain ¶
func (host *VMHostMock) Blockchain() vmhost.BlockchainContext
Blockchain mocked method
func (*VMHostMock) ClearStateStack ¶
func (host *VMHostMock) ClearStateStack()
ClearStateStack mocked method
func (*VMHostMock) CompleteLogEntriesWithCallType ¶ added in v1.5.7
func (host *VMHostMock) CompleteLogEntriesWithCallType(vmOutput *vmcommon.VMOutput, callType string)
CompleteLogEntriesWithCallType mocked method
func (*VMHostMock) CreateNewContract ¶
func (host *VMHostMock) CreateNewContract(_ *vmcommon.ContractCreateInput, _ int) ([]byte, error)
CreateNewContract mocked method
func (*VMHostMock) EnableEpochsHandler ¶
func (host *VMHostMock) EnableEpochsHandler() vmhost.EnableEpochsHandler
EnableEpochsHandler mocked method
func (*VMHostMock) EnqueueVMOutput ¶
func (host *VMHostMock) EnqueueVMOutput(vmOutput *vmcommon.VMOutput)
EnqueueVMOutput enqueues the given VMOutput
func (*VMHostMock) ExecuteESDTTransfer ¶
func (host *VMHostMock) ExecuteESDTTransfer(_ *vmhost.ESDTTransfersArgs, _ vm.CallType) (*vmcommon.VMOutput, uint64, error)
ExecuteESDTTransfer mocked method
func (*VMHostMock) ExecuteOnDestContext ¶
func (host *VMHostMock) ExecuteOnDestContext(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, bool, error)
ExecuteOnDestContext mocked method
func (*VMHostMock) ExecuteOnSameContext ¶
func (host *VMHostMock) ExecuteOnSameContext(_ *vmcommon.ContractCallInput) error
ExecuteOnSameContext mocked method
func (*VMHostMock) FixOOGReturnCodeEnabled ¶
func (host *VMHostMock) FixOOGReturnCodeEnabled() bool
FixOOGReturnCodeEnabled mocked method
func (*VMHostMock) GasScheduleChange ¶
func (host *VMHostMock) GasScheduleChange(_ config.GasScheduleMap)
GasScheduleChange mocked method
func (*VMHostMock) GetContexts ¶
func (host *VMHostMock) GetContexts() ( vmhost.ManagedTypesContext, vmhost.BlockchainContext, vmhost.MeteringContext, vmhost.OutputContext, vmhost.RuntimeContext, vmhost.AsyncContext, vmhost.StorageContext, )
GetContexts mocked method
func (*VMHostMock) GetGasScheduleMap ¶
func (host *VMHostMock) GetGasScheduleMap() config.GasScheduleMap
GetGasScheduleMap mocked method
func (*VMHostMock) GetNextVMOutput ¶
func (host *VMHostMock) GetNextVMOutput() *vmcommon.VMOutput
GetNextVMOutput returns the next VMOutput in the queue
func (*VMHostMock) GetVersion ¶
func (host *VMHostMock) GetVersion() string
GetVersion mocked method
func (*VMHostMock) IsAheadOfTimeCompileEnabled ¶
func (host *VMHostMock) IsAheadOfTimeCompileEnabled() bool
IsAheadOfTimeCompileEnabled mocked method
func (*VMHostMock) IsBuiltinFunctionCall ¶
func (host *VMHostMock) IsBuiltinFunctionCall(_ []byte) bool
IsBuiltinFunctionCall mocked method
func (*VMHostMock) IsBuiltinFunctionName ¶
func (host *VMHostMock) IsBuiltinFunctionName(_ string) bool
IsBuiltinFunctionName mocked method
func (*VMHostMock) IsDynamicGasLockingEnabled ¶
func (host *VMHostMock) IsDynamicGasLockingEnabled() bool
IsDynamicGasLockingEnabled mocked method
func (*VMHostMock) IsESDTFunctionsEnabled ¶
func (host *VMHostMock) IsESDTFunctionsEnabled() bool
IsESDTFunctionsEnabled mocked method
func (*VMHostMock) IsInterfaceNil ¶
func (host *VMHostMock) IsInterfaceNil() bool
IsInterfaceNil mocked method
func (*VMHostMock) ManagedTypes ¶
func (host *VMHostMock) ManagedTypes() vmhost.ManagedTypesContext
ManagedTypes mocked method
func (*VMHostMock) Metering ¶
func (host *VMHostMock) Metering() vmhost.MeteringContext
Metering mocked method
func (*VMHostMock) Output ¶
func (host *VMHostMock) Output() vmhost.OutputContext
Output mocked method
func (*VMHostMock) RunSmartContractCall ¶
func (host *VMHostMock) RunSmartContractCall(_ *vmcommon.ContractCallInput) (vmOutput *vmcommon.VMOutput, err error)
RunSmartContractCall mocked method
func (*VMHostMock) RunSmartContractCreate ¶
func (host *VMHostMock) RunSmartContractCreate(_ *vmcommon.ContractCreateInput) (vmOutput *vmcommon.VMOutput, err error)
RunSmartContractCreate mocked method
func (*VMHostMock) Runtime ¶
func (host *VMHostMock) Runtime() vmhost.RuntimeContext
Runtime mocked method
func (*VMHostMock) SetBuiltInFunctionsContainer ¶
func (host *VMHostMock) SetBuiltInFunctionsContainer(_ vmcommon.BuiltInFunctionContainer)
SetBuiltInFunctionsContainer mocked method
func (*VMHostMock) SetRuntimeContext ¶
func (host *VMHostMock) SetRuntimeContext(runtime vmhost.RuntimeContext)
SetRuntimeContext mocked method
func (*VMHostMock) Storage ¶
func (host *VMHostMock) Storage() vmhost.StorageContext
Storage mocked method
func (*VMHostMock) StoreInput ¶
func (host *VMHostMock) StoreInput(input *vmcommon.ContractCallInput)
StoreInput enqueues the given ContractCallInput
type VMHostStub ¶
type VMHostStub struct { InitStateCalled func() PushStateCalled func() PopStateCalled func() ClearStateStackCalled func() GetVersionCalled func() string CryptoCalled func() crypto.VMCrypto BlockchainCalled func() vmhost.BlockchainContext RuntimeCalled func() vmhost.RuntimeContext OutputCalled func() vmhost.OutputContext MeteringCalled func() vmhost.MeteringContext AsyncCalled func() vmhost.AsyncContext StorageCalled func() vmhost.StorageContext EnableEpochsHandlerCalled func() vmhost.EnableEpochsHandler GetContextsCalled func() (vmhost.ManagedTypesContext, vmhost.BlockchainContext, vmhost.MeteringContext, vmhost.OutputContext, vmhost.RuntimeContext, vmhost.AsyncContext, vmhost.StorageContext) ManagedTypesCalled func() vmhost.ManagedTypesContext ExecuteESDTTransferCalled func(transfersArgs *vmhost.ESDTTransfersArgs, callType vm.CallType) (*vmcommon.VMOutput, uint64, error) CreateNewContractCalled func(input *vmcommon.ContractCreateInput, createContractCallType int) ([]byte, error) ExecuteOnSameContextCalled func(input *vmcommon.ContractCallInput) error ExecuteOnDestContextCalled func(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, bool, error) IsBuiltinFunctionNameCalled func(functionName string) bool IsBuiltinFunctionCallCalled func(data []byte) bool AreInSameShardCalled func(left []byte, right []byte) bool RunSmartContractCallCalled func(input *vmcommon.ContractCallInput) (vmOutput *vmcommon.VMOutput, err error) RunSmartContractCreateCalled func(input *vmcommon.ContractCreateInput) (vmOutput *vmcommon.VMOutput, err error) GetGasScheduleMapCalled func() config.GasScheduleMap GasScheduleChangeCalled func(newGasSchedule config.GasScheduleMap) IsInterfaceNilCalled func() bool CompleteLogEntriesWithCallTypeCalled func(vmOutput *vmcommon.VMOutput, callType string) SetRuntimeContextCalled func(runtime vmhost.RuntimeContext) SetBuiltInFunctionsContainerCalled func(builtInFuncs vmcommon.BuiltInFunctionContainer) UpdateCurrentAsyncCallStatusCalled func(vmInput *vmcommon.VMInput, prevPrevTxHash []byte) (*vmhost.AsyncCall, error) }
VMHostStub is used in tests to check the VMHost interface method calls
func (*VMHostStub) AreInSameShard ¶
func (vhs *VMHostStub) AreInSameShard(left []byte, right []byte) bool
AreInSameShard mocked method
func (*VMHostStub) Blockchain ¶
func (vhs *VMHostStub) Blockchain() vmhost.BlockchainContext
Blockchain mocked method
func (*VMHostStub) ClearStateStack ¶
func (vhs *VMHostStub) ClearStateStack()
ClearStateStack mocked method
func (*VMHostStub) CompleteLogEntriesWithCallType ¶ added in v1.5.7
func (vhs *VMHostStub) CompleteLogEntriesWithCallType(vmOutput *vmcommon.VMOutput, callType string)
CompleteLogEntriesWithCallType mocked method
func (*VMHostStub) CreateNewContract ¶
func (vhs *VMHostStub) CreateNewContract(input *vmcommon.ContractCreateInput, createContractCallType int) ([]byte, error)
CreateNewContract mocked method
func (*VMHostStub) EnableEpochsHandler ¶
func (vhs *VMHostStub) EnableEpochsHandler() vmhost.EnableEpochsHandler
EnableEpochsHandler mocked method
func (*VMHostStub) ExecuteESDTTransfer ¶
func (vhs *VMHostStub) ExecuteESDTTransfer(transfersArgs *vmhost.ESDTTransfersArgs, callType vm.CallType) (*vmcommon.VMOutput, uint64, error)
ExecuteESDTTransfer mocked method
func (*VMHostStub) ExecuteOnDestContext ¶
func (vhs *VMHostStub) ExecuteOnDestContext(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, bool, error)
ExecuteOnDestContext mocked method
func (*VMHostStub) ExecuteOnSameContext ¶
func (vhs *VMHostStub) ExecuteOnSameContext(input *vmcommon.ContractCallInput) error
ExecuteOnSameContext mocked method
func (*VMHostStub) GasScheduleChange ¶
func (vhs *VMHostStub) GasScheduleChange(newGasSchedule config.GasScheduleMap)
GasScheduleChange mocked method
func (*VMHostStub) GetContexts ¶
func (vhs *VMHostStub) GetContexts() ( vmhost.ManagedTypesContext, vmhost.BlockchainContext, vmhost.MeteringContext, vmhost.OutputContext, vmhost.RuntimeContext, vmhost.AsyncContext, vmhost.StorageContext, )
GetContexts mocked method
func (*VMHostStub) GetGasScheduleMap ¶
func (vhs *VMHostStub) GetGasScheduleMap() config.GasScheduleMap
GetGasScheduleMap returns the currently stored gas schedule
func (*VMHostStub) IsAheadOfTimeCompileEnabled ¶
func (vhs *VMHostStub) IsAheadOfTimeCompileEnabled() bool
IsAheadOfTimeCompileEnabled mocked method
func (*VMHostStub) IsBuiltinFunctionCall ¶
func (vhs *VMHostStub) IsBuiltinFunctionCall(data []byte) bool
IsBuiltinFunctionCall mocked method
func (*VMHostStub) IsBuiltinFunctionName ¶
func (vhs *VMHostStub) IsBuiltinFunctionName(functionName string) bool
IsBuiltinFunctionName mocked method
func (*VMHostStub) IsDynamicGasLockingEnabled ¶
func (vhs *VMHostStub) IsDynamicGasLockingEnabled() bool
IsDynamicGasLockingEnabled mocked method
func (*VMHostStub) IsESDTFunctionsEnabled ¶
func (vhs *VMHostStub) IsESDTFunctionsEnabled() bool
IsESDTFunctionsEnabled mocked method
func (*VMHostStub) IsInterfaceNil ¶
func (vhs *VMHostStub) IsInterfaceNil() bool
IsInterfaceNil mocked method
func (*VMHostStub) ManagedTypes ¶
func (vhs *VMHostStub) ManagedTypes() vmhost.ManagedTypesContext
ManagedTypes mocked method
func (*VMHostStub) Metering ¶
func (vhs *VMHostStub) Metering() vmhost.MeteringContext
Metering mocked method
func (*VMHostStub) Output ¶
func (vhs *VMHostStub) Output() vmhost.OutputContext
Output mocked method
func (*VMHostStub) RunSmartContractCall ¶
func (vhs *VMHostStub) RunSmartContractCall(input *vmcommon.ContractCallInput) (vmOutput *vmcommon.VMOutput, err error)
RunSmartContractCall mocked method
func (*VMHostStub) RunSmartContractCreate ¶
func (vhs *VMHostStub) RunSmartContractCreate(input *vmcommon.ContractCreateInput) (vmOutput *vmcommon.VMOutput, err error)
RunSmartContractCreate mocked method
func (*VMHostStub) Runtime ¶
func (vhs *VMHostStub) Runtime() vmhost.RuntimeContext
Runtime mocked method
func (*VMHostStub) SetBuiltInFunctionsContainer ¶
func (vhs *VMHostStub) SetBuiltInFunctionsContainer(builtInFuncs vmcommon.BuiltInFunctionContainer)
SetBuiltInFunctionsContainer mocked method
func (*VMHostStub) SetRuntimeContext ¶
func (vhs *VMHostStub) SetRuntimeContext(runtime vmhost.RuntimeContext)
SetRuntimeContext mocked method
func (*VMHostStub) Storage ¶
func (vhs *VMHostStub) Storage() vmhost.StorageContext
Storage mocked method