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

import (
	"sync"

	"github.com/hyperledger/fabric-protos-go/common"
	"github.com/hyperledger/fabric/orderer/consensus/etcdraft"
)

type InactiveChainRegistry struct {
	StopStub        func()
	stopMutex       sync.RWMutex
	stopArgsForCall []struct {
	}
	TrackChainStub        func(string, *common.Block, func())
	trackChainMutex       sync.RWMutex
	trackChainArgsForCall []struct {
		arg1 string
		arg2 *common.Block
		arg3 func()
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *InactiveChainRegistry) Stop() {
	fake.stopMutex.Lock()
	fake.stopArgsForCall = append(fake.stopArgsForCall, struct {
	}{})
	fake.recordInvocation("Stop", []interface{}{})
	fake.stopMutex.Unlock()
	if fake.StopStub != nil {
		fake.StopStub()
	}
}

func (fake *InactiveChainRegistry) StopCallCount() int {
	fake.stopMutex.RLock()
	defer fake.stopMutex.RUnlock()
	return len(fake.stopArgsForCall)
}

func (fake *InactiveChainRegistry) StopCalls(stub func()) {
	fake.stopMutex.Lock()
	defer fake.stopMutex.Unlock()
	fake.StopStub = stub
}

func (fake *InactiveChainRegistry) TrackChain(arg1 string, arg2 *common.Block, arg3 func()) {
	fake.trackChainMutex.Lock()
	fake.trackChainArgsForCall = append(fake.trackChainArgsForCall, struct {
		arg1 string
		arg2 *common.Block
		arg3 func()
	}{arg1, arg2, arg3})
	fake.recordInvocation("TrackChain", []interface{}{arg1, arg2, arg3})
	fake.trackChainMutex.Unlock()
	if fake.TrackChainStub != nil {
		fake.TrackChainStub(arg1, arg2, arg3)
	}
}

func (fake *InactiveChainRegistry) TrackChainCallCount() int {
	fake.trackChainMutex.RLock()
	defer fake.trackChainMutex.RUnlock()
	return len(fake.trackChainArgsForCall)
}

func (fake *InactiveChainRegistry) TrackChainCalls(stub func(string, *common.Block, func())) {
	fake.trackChainMutex.Lock()
	defer fake.trackChainMutex.Unlock()
	fake.TrackChainStub = stub
}

func (fake *InactiveChainRegistry) TrackChainArgsForCall(i int) (string, *common.Block, func()) {
	fake.trackChainMutex.RLock()
	defer fake.trackChainMutex.RUnlock()
	argsForCall := fake.trackChainArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

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

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

var _ etcdraft.InactiveChainRegistry = new(InactiveChainRegistry)
