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

import (
	"sync"

	"github.com/hyperledger/fabric-protos-go-apiv2/common"
)

type ClusterConsenter struct {
	IsChannelMemberStub        func(*common.Block) (bool, error)
	isChannelMemberMutex       sync.RWMutex
	isChannelMemberArgsForCall []struct {
		arg1 *common.Block
	}
	isChannelMemberReturns struct {
		result1 bool
		result2 error
	}
	isChannelMemberReturnsOnCall map[int]struct {
		result1 bool
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *ClusterConsenter) IsChannelMember(arg1 *common.Block) (bool, error) {
	fake.isChannelMemberMutex.Lock()
	ret, specificReturn := fake.isChannelMemberReturnsOnCall[len(fake.isChannelMemberArgsForCall)]
	fake.isChannelMemberArgsForCall = append(fake.isChannelMemberArgsForCall, struct {
		arg1 *common.Block
	}{arg1})
	stub := fake.IsChannelMemberStub
	fakeReturns := fake.isChannelMemberReturns
	fake.recordInvocation("IsChannelMember", []interface{}{arg1})
	fake.isChannelMemberMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *ClusterConsenter) IsChannelMemberCallCount() int {
	fake.isChannelMemberMutex.RLock()
	defer fake.isChannelMemberMutex.RUnlock()
	return len(fake.isChannelMemberArgsForCall)
}

func (fake *ClusterConsenter) IsChannelMemberCalls(stub func(*common.Block) (bool, error)) {
	fake.isChannelMemberMutex.Lock()
	defer fake.isChannelMemberMutex.Unlock()
	fake.IsChannelMemberStub = stub
}

func (fake *ClusterConsenter) IsChannelMemberArgsForCall(i int) *common.Block {
	fake.isChannelMemberMutex.RLock()
	defer fake.isChannelMemberMutex.RUnlock()
	argsForCall := fake.isChannelMemberArgsForCall[i]
	return argsForCall.arg1
}

func (fake *ClusterConsenter) IsChannelMemberReturns(result1 bool, result2 error) {
	fake.isChannelMemberMutex.Lock()
	defer fake.isChannelMemberMutex.Unlock()
	fake.IsChannelMemberStub = nil
	fake.isChannelMemberReturns = struct {
		result1 bool
		result2 error
	}{result1, result2}
}

func (fake *ClusterConsenter) IsChannelMemberReturnsOnCall(i int, result1 bool, result2 error) {
	fake.isChannelMemberMutex.Lock()
	defer fake.isChannelMemberMutex.Unlock()
	fake.IsChannelMemberStub = nil
	if fake.isChannelMemberReturnsOnCall == nil {
		fake.isChannelMemberReturnsOnCall = make(map[int]struct {
			result1 bool
			result2 error
		})
	}
	fake.isChannelMemberReturnsOnCall[i] = struct {
		result1 bool
		result2 error
	}{result1, result2}
}

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

func (fake *ClusterConsenter) 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)
}
