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

package mocks

import (
	"context"
	"github.com/BitBoxSwiss/bitbox-wallet-app/backend/coins/eth"
	ethcommon "github.com/ethereum/go-ethereum/common"
	"math/big"
	"sync"
)

// Ensure, that BalanceAndBlockNumberFetcherMock does implement eth.BalanceAndBlockNumberFetcher.
// If this is not the case, regenerate this file with moq.
var _ eth.BalanceAndBlockNumberFetcher = &BalanceAndBlockNumberFetcherMock{}

// BalanceAndBlockNumberFetcherMock is a mock implementation of eth.BalanceAndBlockNumberFetcher.
//
//	func TestSomethingThatUsesBalanceAndBlockNumberFetcher(t *testing.T) {
//
//		// make and configure a mocked eth.BalanceAndBlockNumberFetcher
//		mockedBalanceAndBlockNumberFetcher := &BalanceAndBlockNumberFetcherMock{
//			BalancesFunc: func(ctx context.Context, addresses []ethcommon.Address) (map[ethcommon.Address]*big.Int, error) {
//				panic("mock out the Balances method")
//			},
//			BlockNumberFunc: func(ctx context.Context) (*big.Int, error) {
//				panic("mock out the BlockNumber method")
//			},
//		}
//
//		// use mockedBalanceAndBlockNumberFetcher in code that requires eth.BalanceAndBlockNumberFetcher
//		// and then make assertions.
//
//	}
type BalanceAndBlockNumberFetcherMock struct {
	// BalancesFunc mocks the Balances method.
	BalancesFunc func(ctx context.Context, addresses []ethcommon.Address) (map[ethcommon.Address]*big.Int, error)

	// BlockNumberFunc mocks the BlockNumber method.
	BlockNumberFunc func(ctx context.Context) (*big.Int, error)

	// calls tracks calls to the methods.
	calls struct {
		// Balances holds details about calls to the Balances method.
		Balances []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Addresses is the addresses argument value.
			Addresses []ethcommon.Address
		}
		// BlockNumber holds details about calls to the BlockNumber method.
		BlockNumber []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
		}
	}
	lockBalances    sync.RWMutex
	lockBlockNumber sync.RWMutex
}

// Balances calls BalancesFunc.
func (mock *BalanceAndBlockNumberFetcherMock) Balances(ctx context.Context, addresses []ethcommon.Address) (map[ethcommon.Address]*big.Int, error) {
	if mock.BalancesFunc == nil {
		panic("BalanceAndBlockNumberFetcherMock.BalancesFunc: method is nil but BalanceAndBlockNumberFetcher.Balances was just called")
	}
	callInfo := struct {
		Ctx       context.Context
		Addresses []ethcommon.Address
	}{
		Ctx:       ctx,
		Addresses: addresses,
	}
	mock.lockBalances.Lock()
	mock.calls.Balances = append(mock.calls.Balances, callInfo)
	mock.lockBalances.Unlock()
	return mock.BalancesFunc(ctx, addresses)
}

// BalancesCalls gets all the calls that were made to Balances.
// Check the length with:
//
//	len(mockedBalanceAndBlockNumberFetcher.BalancesCalls())
func (mock *BalanceAndBlockNumberFetcherMock) BalancesCalls() []struct {
	Ctx       context.Context
	Addresses []ethcommon.Address
} {
	var calls []struct {
		Ctx       context.Context
		Addresses []ethcommon.Address
	}
	mock.lockBalances.RLock()
	calls = mock.calls.Balances
	mock.lockBalances.RUnlock()
	return calls
}

// BlockNumber calls BlockNumberFunc.
func (mock *BalanceAndBlockNumberFetcherMock) BlockNumber(ctx context.Context) (*big.Int, error) {
	if mock.BlockNumberFunc == nil {
		panic("BalanceAndBlockNumberFetcherMock.BlockNumberFunc: method is nil but BalanceAndBlockNumberFetcher.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(mockedBalanceAndBlockNumberFetcher.BlockNumberCalls())
func (mock *BalanceAndBlockNumberFetcherMock) BlockNumberCalls() []struct {
	Ctx context.Context
} {
	var calls []struct {
		Ctx context.Context
	}
	mock.lockBlockNumber.RLock()
	calls = mock.calls.BlockNumber
	mock.lockBlockNumber.RUnlock()
	return calls
}
