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

package mock

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

// Ensure, that ClientMock does implement rpc.Client.
// If this is not the case, regenerate this file with moq.
var _ rpc.Client = &ClientMock{}

// ClientMock is a mock implementation of rpc.Client.
//
//	func TestSomethingThatUsesClient(t *testing.T) {
//
//		// make and configure a mocked rpc.Client
//		mockedClient := &ClientMock{
//			CloseFunc: func()  {
//				panic("mock out the Close method")
//			},
//			HeaderByNumberFunc: func(ctx context.Context, number *big.Int) (*rpc.Header, error) {
//				panic("mock out the HeaderByNumber method")
//			},
//			LatestFinalizedBlockNumberFunc: func(ctx context.Context, confirmations uint64) (*big.Int, error) {
//				panic("mock out the LatestFinalizedBlockNumber method")
//			},
//			TransactionReceiptsFunc: func(ctx context.Context, txHashes []common.Hash) ([]rpc.TxReceiptResult, error) {
//				panic("mock out the TransactionReceipts method")
//			},
//		}
//
//		// use mockedClient in code that requires rpc.Client
//		// and then make assertions.
//
//	}
type ClientMock struct {
	// CloseFunc mocks the Close method.
	CloseFunc func()

	// HeaderByNumberFunc mocks the HeaderByNumber method.
	HeaderByNumberFunc func(ctx context.Context, number *big.Int) (*rpc.Header, error)

	// LatestFinalizedBlockNumberFunc mocks the LatestFinalizedBlockNumber method.
	LatestFinalizedBlockNumberFunc func(ctx context.Context, confirmations uint64) (*big.Int, error)

	// TransactionReceiptsFunc mocks the TransactionReceipts method.
	TransactionReceiptsFunc func(ctx context.Context, txHashes []common.Hash) ([]rpc.TxReceiptResult, error)

	// calls tracks calls to the methods.
	calls struct {
		// Close holds details about calls to the Close method.
		Close []struct {
		}
		// HeaderByNumber holds details about calls to the HeaderByNumber method.
		HeaderByNumber []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Number is the number argument value.
			Number *big.Int
		}
		// LatestFinalizedBlockNumber holds details about calls to the LatestFinalizedBlockNumber method.
		LatestFinalizedBlockNumber []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Confirmations is the confirmations argument value.
			Confirmations uint64
		}
		// TransactionReceipts holds details about calls to the TransactionReceipts method.
		TransactionReceipts []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// TxHashes is the txHashes argument value.
			TxHashes []common.Hash
		}
	}
	lockClose                      sync.RWMutex
	lockHeaderByNumber             sync.RWMutex
	lockLatestFinalizedBlockNumber sync.RWMutex
	lockTransactionReceipts        sync.RWMutex
}

// Close calls CloseFunc.
func (mock *ClientMock) Close() {
	if mock.CloseFunc == nil {
		panic("ClientMock.CloseFunc: method is nil but Client.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(mockedClient.CloseCalls())
func (mock *ClientMock) CloseCalls() []struct {
} {
	var calls []struct {
	}
	mock.lockClose.RLock()
	calls = mock.calls.Close
	mock.lockClose.RUnlock()
	return calls
}

// HeaderByNumber calls HeaderByNumberFunc.
func (mock *ClientMock) HeaderByNumber(ctx context.Context, number *big.Int) (*rpc.Header, error) {
	if mock.HeaderByNumberFunc == nil {
		panic("ClientMock.HeaderByNumberFunc: method is nil but Client.HeaderByNumber was just called")
	}
	callInfo := struct {
		Ctx    context.Context
		Number *big.Int
	}{
		Ctx:    ctx,
		Number: number,
	}
	mock.lockHeaderByNumber.Lock()
	mock.calls.HeaderByNumber = append(mock.calls.HeaderByNumber, callInfo)
	mock.lockHeaderByNumber.Unlock()
	return mock.HeaderByNumberFunc(ctx, number)
}

// HeaderByNumberCalls gets all the calls that were made to HeaderByNumber.
// Check the length with:
//
//	len(mockedClient.HeaderByNumberCalls())
func (mock *ClientMock) HeaderByNumberCalls() []struct {
	Ctx    context.Context
	Number *big.Int
} {
	var calls []struct {
		Ctx    context.Context
		Number *big.Int
	}
	mock.lockHeaderByNumber.RLock()
	calls = mock.calls.HeaderByNumber
	mock.lockHeaderByNumber.RUnlock()
	return calls
}

// LatestFinalizedBlockNumber calls LatestFinalizedBlockNumberFunc.
func (mock *ClientMock) LatestFinalizedBlockNumber(ctx context.Context, confirmations uint64) (*big.Int, error) {
	if mock.LatestFinalizedBlockNumberFunc == nil {
		panic("ClientMock.LatestFinalizedBlockNumberFunc: method is nil but Client.LatestFinalizedBlockNumber was just called")
	}
	callInfo := struct {
		Ctx           context.Context
		Confirmations uint64
	}{
		Ctx:           ctx,
		Confirmations: confirmations,
	}
	mock.lockLatestFinalizedBlockNumber.Lock()
	mock.calls.LatestFinalizedBlockNumber = append(mock.calls.LatestFinalizedBlockNumber, callInfo)
	mock.lockLatestFinalizedBlockNumber.Unlock()
	return mock.LatestFinalizedBlockNumberFunc(ctx, confirmations)
}

// LatestFinalizedBlockNumberCalls gets all the calls that were made to LatestFinalizedBlockNumber.
// Check the length with:
//
//	len(mockedClient.LatestFinalizedBlockNumberCalls())
func (mock *ClientMock) LatestFinalizedBlockNumberCalls() []struct {
	Ctx           context.Context
	Confirmations uint64
} {
	var calls []struct {
		Ctx           context.Context
		Confirmations uint64
	}
	mock.lockLatestFinalizedBlockNumber.RLock()
	calls = mock.calls.LatestFinalizedBlockNumber
	mock.lockLatestFinalizedBlockNumber.RUnlock()
	return calls
}

// TransactionReceipts calls TransactionReceiptsFunc.
func (mock *ClientMock) TransactionReceipts(ctx context.Context, txHashes []common.Hash) ([]rpc.TxReceiptResult, error) {
	if mock.TransactionReceiptsFunc == nil {
		panic("ClientMock.TransactionReceiptsFunc: method is nil but Client.TransactionReceipts was just called")
	}
	callInfo := struct {
		Ctx      context.Context
		TxHashes []common.Hash
	}{
		Ctx:      ctx,
		TxHashes: txHashes,
	}
	mock.lockTransactionReceipts.Lock()
	mock.calls.TransactionReceipts = append(mock.calls.TransactionReceipts, callInfo)
	mock.lockTransactionReceipts.Unlock()
	return mock.TransactionReceiptsFunc(ctx, txHashes)
}

// TransactionReceiptsCalls gets all the calls that were made to TransactionReceipts.
// Check the length with:
//
//	len(mockedClient.TransactionReceiptsCalls())
func (mock *ClientMock) TransactionReceiptsCalls() []struct {
	Ctx      context.Context
	TxHashes []common.Hash
} {
	var calls []struct {
		Ctx      context.Context
		TxHashes []common.Hash
	}
	mock.lockTransactionReceipts.RLock()
	calls = mock.calls.TransactionReceipts
	mock.lockTransactionReceipts.RUnlock()
	return calls
}
