// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq

package mock

import (
	"context"
	evmrpc "github.com/axelarnetwork/axelar-core/vald/evm/rpc"
	"github.com/ethereum/go-ethereum"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/core/types"
	ethereumrpc "github.com/ethereum/go-ethereum/rpc"
	"math/big"
	"sync"
)

// Ensure, that EthereumJSONRPCClientMock does implement evmrpc.EthereumJSONRPCClient.
// If this is not the case, regenerate this file with moq.
var _ evmrpc.EthereumJSONRPCClient = &EthereumJSONRPCClientMock{}

// EthereumJSONRPCClientMock is a mock implementation of evmrpc.EthereumJSONRPCClient.
//
//	func TestSomethingThatUsesEthereumJSONRPCClient(t *testing.T) {
//
//		// make and configure a mocked evmrpc.EthereumJSONRPCClient
//		mockedEthereumJSONRPCClient := &EthereumJSONRPCClientMock{
//			BlockNumberFunc: func(ctx context.Context) (uint64, error) {
//				panic("mock out the BlockNumber method")
//			},
//			CallContractFunc: func(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) {
//				panic("mock out the CallContract method")
//			},
//			CloseFunc: func()  {
//				panic("mock out the Close method")
//			},
//			FilterLogsFunc: func(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) {
//				panic("mock out the FilterLogs method")
//			},
//			TransactionReceiptFunc: func(ctx context.Context, txHash common.Hash) (*types.Receipt, error) {
//				panic("mock out the TransactionReceipt method")
//			},
//		}
//
//		// use mockedEthereumJSONRPCClient in code that requires evmrpc.EthereumJSONRPCClient
//		// and then make assertions.
//
//	}
type EthereumJSONRPCClientMock struct {
	// BlockNumberFunc mocks the BlockNumber method.
	BlockNumberFunc func(ctx context.Context) (uint64, error)

	// CallContractFunc mocks the CallContract method.
	CallContractFunc func(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)

	// CloseFunc mocks the Close method.
	CloseFunc func()

	// FilterLogsFunc mocks the FilterLogs method.
	FilterLogsFunc func(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)

	// TransactionReceiptFunc mocks the TransactionReceipt method.
	TransactionReceiptFunc func(ctx context.Context, txHash common.Hash) (*types.Receipt, error)

	// calls tracks calls to the methods.
	calls struct {
		// BlockNumber holds details about calls to the BlockNumber method.
		BlockNumber []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
		}
		// CallContract holds details about calls to the CallContract method.
		CallContract []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Msg is the msg argument value.
			Msg ethereum.CallMsg
			// BlockNumber is the blockNumber argument value.
			BlockNumber *big.Int
		}
		// Close holds details about calls to the Close method.
		Close []struct {
		}
		// FilterLogs holds details about calls to the FilterLogs method.
		FilterLogs []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Q is the q argument value.
			Q ethereum.FilterQuery
		}
		// TransactionReceipt holds details about calls to the TransactionReceipt method.
		TransactionReceipt []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// TxHash is the txHash argument value.
			TxHash common.Hash
		}
	}
	lockBlockNumber        sync.RWMutex
	lockCallContract       sync.RWMutex
	lockClose              sync.RWMutex
	lockFilterLogs         sync.RWMutex
	lockTransactionReceipt sync.RWMutex
}

// BlockNumber calls BlockNumberFunc.
func (mock *EthereumJSONRPCClientMock) BlockNumber(ctx context.Context) (uint64, error) {
	if mock.BlockNumberFunc == nil {
		panic("EthereumJSONRPCClientMock.BlockNumberFunc: method is nil but EthereumJSONRPCClient.BlockNumber was just called")
	}
	callInfo := struct {
		Ctx context.Context
	}{
		Ctx: ctx,
	}
	mock.lockBlockNumber.Lock()
	mock.calls.BlockNumber = append(mock.calls.BlockNumber, callInfo)
	mock.lockBlockNumber.Unlock()
	return mock.BlockNumberFunc(ctx)
}

// BlockNumberCalls gets all the calls that were made to BlockNumber.
// Check the length with:
//
//	len(mockedEthereumJSONRPCClient.BlockNumberCalls())
func (mock *EthereumJSONRPCClientMock) BlockNumberCalls() []struct {
	Ctx context.Context
} {
	var calls []struct {
		Ctx context.Context
	}
	mock.lockBlockNumber.RLock()
	calls = mock.calls.BlockNumber
	mock.lockBlockNumber.RUnlock()
	return calls
}

// CallContract calls CallContractFunc.
func (mock *EthereumJSONRPCClientMock) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) {
	if mock.CallContractFunc == nil {
		panic("EthereumJSONRPCClientMock.CallContractFunc: method is nil but EthereumJSONRPCClient.CallContract was just called")
	}
	callInfo := struct {
		Ctx         context.Context
		Msg         ethereum.CallMsg
		BlockNumber *big.Int
	}{
		Ctx:         ctx,
		Msg:         msg,
		BlockNumber: blockNumber,
	}
	mock.lockCallContract.Lock()
	mock.calls.CallContract = append(mock.calls.CallContract, callInfo)
	mock.lockCallContract.Unlock()
	return mock.CallContractFunc(ctx, msg, blockNumber)
}

// CallContractCalls gets all the calls that were made to CallContract.
// Check the length with:
//
//	len(mockedEthereumJSONRPCClient.CallContractCalls())
func (mock *EthereumJSONRPCClientMock) CallContractCalls() []struct {
	Ctx         context.Context
	Msg         ethereum.CallMsg
	BlockNumber *big.Int
} {
	var calls []struct {
		Ctx         context.Context
		Msg         ethereum.CallMsg
		BlockNumber *big.Int
	}
	mock.lockCallContract.RLock()
	calls = mock.calls.CallContract
	mock.lockCallContract.RUnlock()
	return calls
}

// Close calls CloseFunc.
func (mock *EthereumJSONRPCClientMock) Close() {
	if mock.CloseFunc == nil {
		panic("EthereumJSONRPCClientMock.CloseFunc: method is nil but EthereumJSONRPCClient.Close was just called")
	}
	callInfo := struct {
	}{}
	mock.lockClose.Lock()
	mock.calls.Close = append(mock.calls.Close, callInfo)
	mock.lockClose.Unlock()
	mock.CloseFunc()
}

// CloseCalls gets all the calls that were made to Close.
// Check the length with:
//
//	len(mockedEthereumJSONRPCClient.CloseCalls())
func (mock *EthereumJSONRPCClientMock) CloseCalls() []struct {
} {
	var calls []struct {
	}
	mock.lockClose.RLock()
	calls = mock.calls.Close
	mock.lockClose.RUnlock()
	return calls
}

// FilterLogs calls FilterLogsFunc.
func (mock *EthereumJSONRPCClientMock) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) {
	if mock.FilterLogsFunc == nil {
		panic("EthereumJSONRPCClientMock.FilterLogsFunc: method is nil but EthereumJSONRPCClient.FilterLogs was just called")
	}
	callInfo := struct {
		Ctx context.Context
		Q   ethereum.FilterQuery
	}{
		Ctx: ctx,
		Q:   q,
	}
	mock.lockFilterLogs.Lock()
	mock.calls.FilterLogs = append(mock.calls.FilterLogs, callInfo)
	mock.lockFilterLogs.Unlock()
	return mock.FilterLogsFunc(ctx, q)
}

// FilterLogsCalls gets all the calls that were made to FilterLogs.
// Check the length with:
//
//	len(mockedEthereumJSONRPCClient.FilterLogsCalls())
func (mock *EthereumJSONRPCClientMock) FilterLogsCalls() []struct {
	Ctx context.Context
	Q   ethereum.FilterQuery
} {
	var calls []struct {
		Ctx context.Context
		Q   ethereum.FilterQuery
	}
	mock.lockFilterLogs.RLock()
	calls = mock.calls.FilterLogs
	mock.lockFilterLogs.RUnlock()
	return calls
}

// TransactionReceipt calls TransactionReceiptFunc.
func (mock *EthereumJSONRPCClientMock) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) {
	if mock.TransactionReceiptFunc == nil {
		panic("EthereumJSONRPCClientMock.TransactionReceiptFunc: method is nil but EthereumJSONRPCClient.TransactionReceipt was just called")
	}
	callInfo := struct {
		Ctx    context.Context
		TxHash common.Hash
	}{
		Ctx:    ctx,
		TxHash: txHash,
	}
	mock.lockTransactionReceipt.Lock()
	mock.calls.TransactionReceipt = append(mock.calls.TransactionReceipt, callInfo)
	mock.lockTransactionReceipt.Unlock()
	return mock.TransactionReceiptFunc(ctx, txHash)
}

// TransactionReceiptCalls gets all the calls that were made to TransactionReceipt.
// Check the length with:
//
//	len(mockedEthereumJSONRPCClient.TransactionReceiptCalls())
func (mock *EthereumJSONRPCClientMock) TransactionReceiptCalls() []struct {
	Ctx    context.Context
	TxHash common.Hash
} {
	var calls []struct {
		Ctx    context.Context
		TxHash common.Hash
	}
	mock.lockTransactionReceipt.RLock()
	calls = mock.calls.TransactionReceipt
	mock.lockTransactionReceipt.RUnlock()
	return calls
}

// Ensure, that JSONRPCClientMock does implement evmrpc.JSONRPCClient.
// If this is not the case, regenerate this file with moq.
var _ evmrpc.JSONRPCClient = &JSONRPCClientMock{}

// JSONRPCClientMock is a mock implementation of evmrpc.JSONRPCClient.
//
//	func TestSomethingThatUsesJSONRPCClient(t *testing.T) {
//
//		// make and configure a mocked evmrpc.JSONRPCClient
//		mockedJSONRPCClient := &JSONRPCClientMock{
//			BatchCallContextFunc: func(ctx context.Context, b []ethereumrpc.BatchElem) error {
//				panic("mock out the BatchCallContext method")
//			},
//			CallContextFunc: func(ctx context.Context, result interface{}, method string, args ...interface{}) error {
//				panic("mock out the CallContext method")
//			},
//		}
//
//		// use mockedJSONRPCClient in code that requires evmrpc.JSONRPCClient
//		// and then make assertions.
//
//	}
type JSONRPCClientMock struct {
	// BatchCallContextFunc mocks the BatchCallContext method.
	BatchCallContextFunc func(ctx context.Context, b []ethereumrpc.BatchElem) error

	// CallContextFunc mocks the CallContext method.
	CallContextFunc func(ctx context.Context, result interface{}, method string, args ...interface{}) error

	// calls tracks calls to the methods.
	calls struct {
		// BatchCallContext holds details about calls to the BatchCallContext method.
		BatchCallContext []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// B is the b argument value.
			B []ethereumrpc.BatchElem
		}
		// CallContext holds details about calls to the CallContext method.
		CallContext []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Result is the result argument value.
			Result interface{}
			// Method is the method argument value.
			Method string
			// Args is the args argument value.
			Args []interface{}
		}
	}
	lockBatchCallContext sync.RWMutex
	lockCallContext      sync.RWMutex
}

// BatchCallContext calls BatchCallContextFunc.
func (mock *JSONRPCClientMock) BatchCallContext(ctx context.Context, b []ethereumrpc.BatchElem) error {
	if mock.BatchCallContextFunc == nil {
		panic("JSONRPCClientMock.BatchCallContextFunc: method is nil but JSONRPCClient.BatchCallContext was just called")
	}
	callInfo := struct {
		Ctx context.Context
		B   []ethereumrpc.BatchElem
	}{
		Ctx: ctx,
		B:   b,
	}
	mock.lockBatchCallContext.Lock()
	mock.calls.BatchCallContext = append(mock.calls.BatchCallContext, callInfo)
	mock.lockBatchCallContext.Unlock()
	return mock.BatchCallContextFunc(ctx, b)
}

// BatchCallContextCalls gets all the calls that were made to BatchCallContext.
// Check the length with:
//
//	len(mockedJSONRPCClient.BatchCallContextCalls())
func (mock *JSONRPCClientMock) BatchCallContextCalls() []struct {
	Ctx context.Context
	B   []ethereumrpc.BatchElem
} {
	var calls []struct {
		Ctx context.Context
		B   []ethereumrpc.BatchElem
	}
	mock.lockBatchCallContext.RLock()
	calls = mock.calls.BatchCallContext
	mock.lockBatchCallContext.RUnlock()
	return calls
}

// CallContext calls CallContextFunc.
func (mock *JSONRPCClientMock) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error {
	if mock.CallContextFunc == nil {
		panic("JSONRPCClientMock.CallContextFunc: method is nil but JSONRPCClient.CallContext was just called")
	}
	callInfo := struct {
		Ctx    context.Context
		Result interface{}
		Method string
		Args   []interface{}
	}{
		Ctx:    ctx,
		Result: result,
		Method: method,
		Args:   args,
	}
	mock.lockCallContext.Lock()
	mock.calls.CallContext = append(mock.calls.CallContext, callInfo)
	mock.lockCallContext.Unlock()
	return mock.CallContextFunc(ctx, result, method, args...)
}

// CallContextCalls gets all the calls that were made to CallContext.
// Check the length with:
//
//	len(mockedJSONRPCClient.CallContextCalls())
func (mock *JSONRPCClientMock) CallContextCalls() []struct {
	Ctx    context.Context
	Result interface{}
	Method string
	Args   []interface{}
} {
	var calls []struct {
		Ctx    context.Context
		Result interface{}
		Method string
		Args   []interface{}
	}
	mock.lockCallContext.RLock()
	calls = mock.calls.CallContext
	mock.lockCallContext.RUnlock()
	return calls
}
