Documentation ¶
Index ¶
- Variables
- func TestFailOnFailingRunner(t *testing.T, fn interface{}, args ...interface{})
- func TestFailsWhenContractNotDeployed(t *testing.T, expectedError error, fn interface{}, args ...interface{})
- func TestReturnsDefaultOnFailingRunner(t *testing.T, defaultValue interface{}, fn interface{}, args ...interface{})
- type AtlasMock
- type BlockchainParametersMock
- func (bp *BlockchainParametersMock) BlockGasLimit() *big.Int
- func (bp *BlockchainParametersMock) GetMinimumClientVersion() (*big.Int, *big.Int, *big.Int)
- func (bp *BlockchainParametersMock) GetUptimeLookbackWindow() *big.Int
- func (bp *BlockchainParametersMock) IntrinsicGasForAlternativeFeeCurrency() *big.Int
- type Contract
- type ContractMock
- type FailingVmRunner
- func (fvm FailingVmRunner) Execute(recipient common.Address, input []byte, gas uint64, value *big.Int) (ret []byte, err error)
- func (fvm FailingVmRunner) ExecuteFrom(sender, recipient common.Address, input []byte, gas uint64, value *big.Int) (ret []byte, err error)
- func (fvm FailingVmRunner) GetStateDB() types.StateDB
- func (fvm FailingVmRunner) Query(recipient common.Address, input []byte, gas uint64) (ret []byte, err error)
- func (fvm FailingVmRunner) StartGasMetering()
- func (fvm FailingVmRunner) StopGasMetering()
- type MethodMock
- type MockEVMRunner
- func (ev *MockEVMRunner) Execute(recipient common.Address, input []byte, gas uint64, value *big.Int) (ret []byte, err error)
- func (ev *MockEVMRunner) ExecuteFrom(sender, recipient common.Address, input []byte, gas uint64, value *big.Int) (ret []byte, err error)
- func (ev *MockEVMRunner) GetStateDB() types.StateDB
- func (ev *MockEVMRunner) Query(recipient common.Address, input []byte, gas uint64) (ret []byte, err error)
- func (ev *MockEVMRunner) RegisterContract(address common.Address, mock Contract)
- func (ev *MockEVMRunner) StartGasMetering()
- func (ev *MockEVMRunner) StopGasMetering()
- type RegistryMock
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFailingRunner = errors.New("failing VMRunner")
ErrFailingRunner error for FailingVmRunner
Functions ¶
func TestFailOnFailingRunner ¶
TestFailOnFailingRunner checks that function doesn't silent VMRunner error
func TestFailsWhenContractNotDeployed ¶
func TestFailsWhenContractNotDeployed(t *testing.T, expectedError error, fn interface{}, args ...interface{})
TestFailsWhenContractNotDeployed check calls fails when contract is not registered
func TestReturnsDefaultOnFailingRunner ¶
func TestReturnsDefaultOnFailingRunner(t *testing.T, defaultValue interface{}, fn interface{}, args ...interface{})
TestReturnsDefaultOnFailingRunner checks that function will return a default value if there's an error on VMRunner
Types ¶
type AtlasMock ¶
type AtlasMock struct { Runner *MockEVMRunner Registry *RegistryMock BlockchainParameters *BlockchainParametersMock }
func NewAtlasMock ¶
func NewAtlasMock() AtlasMock
type BlockchainParametersMock ¶
type BlockchainParametersMock struct { ContractMock MinimumVersion params.VersionInfo BlockGasLimitValue *big.Int LookbackWindow *big.Int IntrinsicGasForAlternativeFeeCurrencyValue *big.Int }
func NewBlockchainParametersMock ¶
func NewBlockchainParametersMock() *BlockchainParametersMock
func (*BlockchainParametersMock) BlockGasLimit ¶
func (bp *BlockchainParametersMock) BlockGasLimit() *big.Int
func (*BlockchainParametersMock) GetMinimumClientVersion ¶
func (*BlockchainParametersMock) GetUptimeLookbackWindow ¶
func (bp *BlockchainParametersMock) GetUptimeLookbackWindow() *big.Int
func (*BlockchainParametersMock) IntrinsicGasForAlternativeFeeCurrency ¶
func (bp *BlockchainParametersMock) IntrinsicGasForAlternativeFeeCurrency() *big.Int
type ContractMock ¶
type ContractMock struct {
// contains filtered or unexported fields
}
func NewContractMock ¶
func NewContractMock(parsedAbi *abi.ABI, handler interface{}) ContractMock
func NewSingleMethodContract ¶
func NewSingleMethodContract(registryId common.Hash, methodName string, mockFn interface{}) *ContractMock
type FailingVmRunner ¶
type FailingVmRunner struct{}
FailingVmRunner is a VMRunner that always fails with a ErrFailingRunner
func (FailingVmRunner) ExecuteFrom ¶
func (FailingVmRunner) GetStateDB ¶
func (fvm FailingVmRunner) GetStateDB() types.StateDB
func (FailingVmRunner) StartGasMetering ¶
func (fvm FailingVmRunner) StartGasMetering()
func (FailingVmRunner) StopGasMetering ¶
func (fvm FailingVmRunner) StopGasMetering()
type MethodMock ¶
type MethodMock struct {
// contains filtered or unexported fields
}
func (*MethodMock) Id ¶
func (mm *MethodMock) Id() []byte
type MockEVMRunner ¶
type MockEVMRunner struct {
// contains filtered or unexported fields
}
func NewMockEVMRunner ¶
func NewMockEVMRunner() *MockEVMRunner
func NewSingleMethodRunner ¶
func NewSingleMethodRunner(registryId common.Hash, methodName string, mockFn interface{}) *MockEVMRunner
func (*MockEVMRunner) ExecuteFrom ¶
func (*MockEVMRunner) GetStateDB ¶
func (ev *MockEVMRunner) GetStateDB() types.StateDB
GetStateDB implements Backend.GetStateDB
func (*MockEVMRunner) RegisterContract ¶
func (ev *MockEVMRunner) RegisterContract(address common.Address, mock Contract)
func (*MockEVMRunner) StartGasMetering ¶
func (ev *MockEVMRunner) StartGasMetering()
func (*MockEVMRunner) StopGasMetering ¶
func (ev *MockEVMRunner) StopGasMetering()
type RegistryMock ¶
type RegistryMock struct { ContractMock Contracts map[common.Hash]common.Address }
func NewRegistryMock ¶
func NewRegistryMock() *RegistryMock
func (*RegistryMock) AddContract ¶
func (rm *RegistryMock) AddContract(id common.Hash, address common.Address)
func (*RegistryMock) GetAddressFor ¶
func (rm *RegistryMock) GetAddressFor(id common.Hash) common.Address
Click to show internal directories.
Click to hide internal directories.