ethergo/chain/client/mocks/evm_client.go
// Code generated by mockery v2.14.0. DO NOT EDIT.
package mocks
import (
big "math/big"
common "github.com/ethereum/go-ethereum/common"
context "context"
ethereum "github.com/ethereum/go-ethereum"
mock "github.com/stretchr/testify/mock"
rpc "github.com/ethereum/go-ethereum/rpc"
types "github.com/ethereum/go-ethereum/core/types"
w3types "github.com/lmittmann/w3/w3types"
)
// EVMClient is an autogenerated mock type for the EVMClient type
type EVMClient struct {
mock.Mock
}
// BalanceAt provides a mock function with given fields: ctx, account, blockNumber
func (_m *EVMClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) {
ret := _m.Called(ctx, account, blockNumber)
var r0 *big.Int
if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) *big.Int); ok {
r0 = rf(ctx, account, blockNumber)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*big.Int)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, common.Address, *big.Int) error); ok {
r1 = rf(ctx, account, blockNumber)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// BatchCallContext provides a mock function with given fields: ctx, b
func (_m *EVMClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error {
ret := _m.Called(ctx, b)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, []rpc.BatchElem) error); ok {
r0 = rf(ctx, b)
} else {
r0 = ret.Error(0)
}
return r0
}
// BatchContext provides a mock function with given fields: ctx, calls
func (_m *EVMClient) BatchContext(ctx context.Context, calls ...w3types.Caller) error {
_va := make([]interface{}, len(calls))
for _i := range calls {
_va[_i] = calls[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, ...w3types.Caller) error); ok {
r0 = rf(ctx, calls...)
} else {
r0 = ret.Error(0)
}
return r0
}
// BlockByHash provides a mock function with given fields: ctx, hash
func (_m *EVMClient) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) {
ret := _m.Called(ctx, hash)
var r0 *types.Block
if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *types.Block); ok {
r0 = rf(ctx, hash)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Block)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, common.Hash) error); ok {
r1 = rf(ctx, hash)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// BlockByNumber provides a mock function with given fields: ctx, number
func (_m *EVMClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) {
ret := _m.Called(ctx, number)
var r0 *types.Block
if rf, ok := ret.Get(0).(func(context.Context, *big.Int) *types.Block); ok {
r0 = rf(ctx, number)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Block)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *big.Int) error); ok {
r1 = rf(ctx, number)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// BlockNumber provides a mock function with given fields: ctx
func (_m *EVMClient) BlockNumber(ctx context.Context) (uint64, error) {
ret := _m.Called(ctx)
var r0 uint64
if rf, ok := ret.Get(0).(func(context.Context) uint64); ok {
r0 = rf(ctx)
} else {
r0 = ret.Get(0).(uint64)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CallContext provides a mock function with given fields: ctx, result, method, args
func (_m *EVMClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error {
var _ca []interface{}
_ca = append(_ca, ctx, result, method)
_ca = append(_ca, args...)
ret := _m.Called(_ca...)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, interface{}, string, ...interface{}) error); ok {
r0 = rf(ctx, result, method, args...)
} else {
r0 = ret.Error(0)
}
return r0
}
// CallContract provides a mock function with given fields: ctx, call, blockNumber
func (_m *EVMClient) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) {
ret := _m.Called(ctx, call, blockNumber)
var r0 []byte
if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg, *big.Int) []byte); ok {
r0 = rf(ctx, call, blockNumber)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, ethereum.CallMsg, *big.Int) error); ok {
r1 = rf(ctx, call, blockNumber)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ChainID provides a mock function with given fields: ctx
func (_m *EVMClient) ChainID(ctx context.Context) (*big.Int, error) {
ret := _m.Called(ctx)
var r0 *big.Int
if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*big.Int)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CodeAt provides a mock function with given fields: ctx, contract, blockNumber
func (_m *EVMClient) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error) {
ret := _m.Called(ctx, contract, blockNumber)
var r0 []byte
if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) []byte); ok {
r0 = rf(ctx, contract, blockNumber)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, common.Address, *big.Int) error); ok {
r1 = rf(ctx, contract, blockNumber)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// EstimateGas provides a mock function with given fields: ctx, call
func (_m *EVMClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) {
ret := _m.Called(ctx, call)
var r0 uint64
if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg) uint64); ok {
r0 = rf(ctx, call)
} else {
r0 = ret.Get(0).(uint64)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, ethereum.CallMsg) error); ok {
r1 = rf(ctx, call)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FeeHistory provides a mock function with given fields: ctx, blockCount, lastBlock, rewardPercentiles
func (_m *EVMClient) FeeHistory(ctx context.Context, blockCount uint64, lastBlock *big.Int, rewardPercentiles []float64) (*ethereum.FeeHistory, error) {
ret := _m.Called(ctx, blockCount, lastBlock, rewardPercentiles)
var r0 *ethereum.FeeHistory
if rf, ok := ret.Get(0).(func(context.Context, uint64, *big.Int, []float64) *ethereum.FeeHistory); ok {
r0 = rf(ctx, blockCount, lastBlock, rewardPercentiles)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*ethereum.FeeHistory)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, uint64, *big.Int, []float64) error); ok {
r1 = rf(ctx, blockCount, lastBlock, rewardPercentiles)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FilterLogs provides a mock function with given fields: ctx, query
func (_m *EVMClient) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) {
ret := _m.Called(ctx, query)
var r0 []types.Log
if rf, ok := ret.Get(0).(func(context.Context, ethereum.FilterQuery) []types.Log); ok {
r0 = rf(ctx, query)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]types.Log)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, ethereum.FilterQuery) error); ok {
r1 = rf(ctx, query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// HeaderByHash provides a mock function with given fields: ctx, hash
func (_m *EVMClient) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) {
ret := _m.Called(ctx, hash)
var r0 *types.Header
if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *types.Header); ok {
r0 = rf(ctx, hash)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Header)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, common.Hash) error); ok {
r1 = rf(ctx, hash)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// HeaderByNumber provides a mock function with given fields: ctx, number
func (_m *EVMClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) {
ret := _m.Called(ctx, number)
var r0 *types.Header
if rf, ok := ret.Get(0).(func(context.Context, *big.Int) *types.Header); ok {
r0 = rf(ctx, number)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Header)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *big.Int) error); ok {
r1 = rf(ctx, number)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NetworkID provides a mock function with given fields: ctx
func (_m *EVMClient) NetworkID(ctx context.Context) (*big.Int, error) {
ret := _m.Called(ctx)
var r0 *big.Int
if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*big.Int)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NonceAt provides a mock function with given fields: ctx, account, blockNumber
func (_m *EVMClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) {
ret := _m.Called(ctx, account, blockNumber)
var r0 uint64
if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) uint64); ok {
r0 = rf(ctx, account, blockNumber)
} else {
r0 = ret.Get(0).(uint64)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, common.Address, *big.Int) error); ok {
r1 = rf(ctx, account, blockNumber)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PendingBalanceAt provides a mock function with given fields: ctx, account
func (_m *EVMClient) PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error) {
ret := _m.Called(ctx, account)
var r0 *big.Int
if rf, ok := ret.Get(0).(func(context.Context, common.Address) *big.Int); ok {
r0 = rf(ctx, account)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*big.Int)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, common.Address) error); ok {
r1 = rf(ctx, account)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PendingCallContract provides a mock function with given fields: ctx, call
func (_m *EVMClient) PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error) {
ret := _m.Called(ctx, call)
var r0 []byte
if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg) []byte); ok {
r0 = rf(ctx, call)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, ethereum.CallMsg) error); ok {
r1 = rf(ctx, call)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PendingCodeAt provides a mock function with given fields: ctx, account
func (_m *EVMClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) {
ret := _m.Called(ctx, account)
var r0 []byte
if rf, ok := ret.Get(0).(func(context.Context, common.Address) []byte); ok {
r0 = rf(ctx, account)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, common.Address) error); ok {
r1 = rf(ctx, account)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PendingNonceAt provides a mock function with given fields: ctx, account
func (_m *EVMClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) {
ret := _m.Called(ctx, account)
var r0 uint64
if rf, ok := ret.Get(0).(func(context.Context, common.Address) uint64); ok {
r0 = rf(ctx, account)
} else {
r0 = ret.Get(0).(uint64)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, common.Address) error); ok {
r1 = rf(ctx, account)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PendingStorageAt provides a mock function with given fields: ctx, account, key
func (_m *EVMClient) PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error) {
ret := _m.Called(ctx, account, key)
var r0 []byte
if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash) []byte); ok {
r0 = rf(ctx, account, key)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, common.Address, common.Hash) error); ok {
r1 = rf(ctx, account, key)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PendingTransactionCount provides a mock function with given fields: ctx
func (_m *EVMClient) PendingTransactionCount(ctx context.Context) (uint, error) {
ret := _m.Called(ctx)
var r0 uint
if rf, ok := ret.Get(0).(func(context.Context) uint); ok {
r0 = rf(ctx)
} else {
r0 = ret.Get(0).(uint)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SendTransaction provides a mock function with given fields: ctx, tx
func (_m *EVMClient) SendTransaction(ctx context.Context, tx *types.Transaction) error {
ret := _m.Called(ctx, tx)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction) error); ok {
r0 = rf(ctx, tx)
} else {
r0 = ret.Error(0)
}
return r0
}
// StorageAt provides a mock function with given fields: ctx, account, key, blockNumber
func (_m *EVMClient) StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error) {
ret := _m.Called(ctx, account, key, blockNumber)
var r0 []byte
if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash, *big.Int) []byte); ok {
r0 = rf(ctx, account, key, blockNumber)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, common.Address, common.Hash, *big.Int) error); ok {
r1 = rf(ctx, account, key, blockNumber)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SubscribeFilterLogs provides a mock function with given fields: ctx, query, ch
func (_m *EVMClient) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) {
ret := _m.Called(ctx, query, ch)
var r0 ethereum.Subscription
if rf, ok := ret.Get(0).(func(context.Context, ethereum.FilterQuery, chan<- types.Log) ethereum.Subscription); ok {
r0 = rf(ctx, query, ch)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(ethereum.Subscription)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, ethereum.FilterQuery, chan<- types.Log) error); ok {
r1 = rf(ctx, query, ch)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SubscribeNewHead provides a mock function with given fields: ctx, ch
func (_m *EVMClient) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) {
ret := _m.Called(ctx, ch)
var r0 ethereum.Subscription
if rf, ok := ret.Get(0).(func(context.Context, chan<- *types.Header) ethereum.Subscription); ok {
r0 = rf(ctx, ch)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(ethereum.Subscription)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, chan<- *types.Header) error); ok {
r1 = rf(ctx, ch)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SuggestGasPrice provides a mock function with given fields: ctx
func (_m *EVMClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) {
ret := _m.Called(ctx)
var r0 *big.Int
if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*big.Int)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SuggestGasTipCap provides a mock function with given fields: ctx
func (_m *EVMClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error) {
ret := _m.Called(ctx)
var r0 *big.Int
if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*big.Int)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SyncProgress provides a mock function with given fields: ctx
func (_m *EVMClient) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error) {
ret := _m.Called(ctx)
var r0 *ethereum.SyncProgress
if rf, ok := ret.Get(0).(func(context.Context) *ethereum.SyncProgress); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*ethereum.SyncProgress)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// TransactionByHash provides a mock function with given fields: ctx, txHash
func (_m *EVMClient) TransactionByHash(ctx context.Context, txHash common.Hash) (*types.Transaction, bool, error) {
ret := _m.Called(ctx, txHash)
var r0 *types.Transaction
if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *types.Transaction); ok {
r0 = rf(ctx, txHash)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Transaction)
}
}
var r1 bool
if rf, ok := ret.Get(1).(func(context.Context, common.Hash) bool); ok {
r1 = rf(ctx, txHash)
} else {
r1 = ret.Get(1).(bool)
}
var r2 error
if rf, ok := ret.Get(2).(func(context.Context, common.Hash) error); ok {
r2 = rf(ctx, txHash)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// TransactionCount provides a mock function with given fields: ctx, blockHash
func (_m *EVMClient) TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error) {
ret := _m.Called(ctx, blockHash)
var r0 uint
if rf, ok := ret.Get(0).(func(context.Context, common.Hash) uint); ok {
r0 = rf(ctx, blockHash)
} else {
r0 = ret.Get(0).(uint)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, common.Hash) error); ok {
r1 = rf(ctx, blockHash)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// TransactionInBlock provides a mock function with given fields: ctx, blockHash, index
func (_m *EVMClient) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error) {
ret := _m.Called(ctx, blockHash, index)
var r0 *types.Transaction
if rf, ok := ret.Get(0).(func(context.Context, common.Hash, uint) *types.Transaction); ok {
r0 = rf(ctx, blockHash, index)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Transaction)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, common.Hash, uint) error); ok {
r1 = rf(ctx, blockHash, index)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// TransactionReceipt provides a mock function with given fields: ctx, txHash
func (_m *EVMClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) {
ret := _m.Called(ctx, txHash)
var r0 *types.Receipt
if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *types.Receipt); ok {
r0 = rf(ctx, txHash)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Receipt)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, common.Hash) error); ok {
r1 = rf(ctx, txHash)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Web3Version provides a mock function with given fields: ctx
func (_m *EVMClient) Web3Version(ctx context.Context) (string, error) {
ret := _m.Called(ctx)
var r0 string
if rf, ok := ret.Get(0).(func(context.Context) string); ok {
r0 = rf(ctx)
} else {
r0 = ret.Get(0).(string)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
type mockConstructorTestingTNewEVMClient interface {
mock.TestingT
Cleanup(func())
}
// NewEVMClient creates a new instance of EVMClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewEVMClient(t mockConstructorTestingTNewEVMClient) *EVMClient {
mock := &EVMClient{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}