// Code generated by counterfeiter. DO NOT EDIT.
package mocks

import (
	"context"
	"sync"

	"github.com/hyperledger/fabric/internal/pkg/gateway/commit"
)

type CommitFinder struct {
	TransactionStatusStub        func(context.Context, string, string) (*commit.Status, error)
	transactionStatusMutex       sync.RWMutex
	transactionStatusArgsForCall []struct {
		arg1 context.Context
		arg2 string
		arg3 string
	}
	transactionStatusReturns struct {
		result1 *commit.Status
		result2 error
	}
	transactionStatusReturnsOnCall map[int]struct {
		result1 *commit.Status
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *CommitFinder) TransactionStatus(arg1 context.Context, arg2 string, arg3 string) (*commit.Status, error) {
	fake.transactionStatusMutex.Lock()
	ret, specificReturn := fake.transactionStatusReturnsOnCall[len(fake.transactionStatusArgsForCall)]
	fake.transactionStatusArgsForCall = append(fake.transactionStatusArgsForCall, struct {
		arg1 context.Context
		arg2 string
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.TransactionStatusStub
	fakeReturns := fake.transactionStatusReturns
	fake.recordInvocation("TransactionStatus", []interface{}{arg1, arg2, arg3})
	fake.transactionStatusMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CommitFinder) TransactionStatusCallCount() int {
	fake.transactionStatusMutex.RLock()
	defer fake.transactionStatusMutex.RUnlock()
	return len(fake.transactionStatusArgsForCall)
}

func (fake *CommitFinder) TransactionStatusCalls(stub func(context.Context, string, string) (*commit.Status, error)) {
	fake.transactionStatusMutex.Lock()
	defer fake.transactionStatusMutex.Unlock()
	fake.TransactionStatusStub = stub
}

func (fake *CommitFinder) TransactionStatusArgsForCall(i int) (context.Context, string, string) {
	fake.transactionStatusMutex.RLock()
	defer fake.transactionStatusMutex.RUnlock()
	argsForCall := fake.transactionStatusArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CommitFinder) TransactionStatusReturns(result1 *commit.Status, result2 error) {
	fake.transactionStatusMutex.Lock()
	defer fake.transactionStatusMutex.Unlock()
	fake.TransactionStatusStub = nil
	fake.transactionStatusReturns = struct {
		result1 *commit.Status
		result2 error
	}{result1, result2}
}

func (fake *CommitFinder) TransactionStatusReturnsOnCall(i int, result1 *commit.Status, result2 error) {
	fake.transactionStatusMutex.Lock()
	defer fake.transactionStatusMutex.Unlock()
	fake.TransactionStatusStub = nil
	if fake.transactionStatusReturnsOnCall == nil {
		fake.transactionStatusReturnsOnCall = make(map[int]struct {
			result1 *commit.Status
			result2 error
		})
	}
	fake.transactionStatusReturnsOnCall[i] = struct {
		result1 *commit.Status
		result2 error
	}{result1, result2}
}

func (fake *CommitFinder) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.transactionStatusMutex.RLock()
	defer fake.transactionStatusMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *CommitFinder) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}
