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

import (
	"sync"

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

type BFTBlockDeliverer struct {
	DeliverBlocksStub        func()
	deliverBlocksMutex       sync.RWMutex
	deliverBlocksArgsForCall []struct {
	}
	InitializeStub        func(*common.Config, string)
	initializeMutex       sync.RWMutex
	initializeArgsForCall []struct {
		arg1 *common.Config
		arg2 string
	}
	StopStub        func()
	stopMutex       sync.RWMutex
	stopArgsForCall []struct {
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *BFTBlockDeliverer) DeliverBlocks() {
	fake.deliverBlocksMutex.Lock()
	fake.deliverBlocksArgsForCall = append(fake.deliverBlocksArgsForCall, struct {
	}{})
	stub := fake.DeliverBlocksStub
	fake.recordInvocation("DeliverBlocks", []interface{}{})
	fake.deliverBlocksMutex.Unlock()
	if stub != nil {
		fake.DeliverBlocksStub()
	}
}

func (fake *BFTBlockDeliverer) DeliverBlocksCallCount() int {
	fake.deliverBlocksMutex.RLock()
	defer fake.deliverBlocksMutex.RUnlock()
	return len(fake.deliverBlocksArgsForCall)
}

func (fake *BFTBlockDeliverer) DeliverBlocksCalls(stub func()) {
	fake.deliverBlocksMutex.Lock()
	defer fake.deliverBlocksMutex.Unlock()
	fake.DeliverBlocksStub = stub
}

func (fake *BFTBlockDeliverer) Initialize(arg1 *common.Config, arg2 string) {
	fake.initializeMutex.Lock()
	fake.initializeArgsForCall = append(fake.initializeArgsForCall, struct {
		arg1 *common.Config
		arg2 string
	}{arg1, arg2})
	stub := fake.InitializeStub
	fake.recordInvocation("Initialize", []interface{}{arg1, arg2})
	fake.initializeMutex.Unlock()
	if stub != nil {
		fake.InitializeStub(arg1, arg2)
	}
}

func (fake *BFTBlockDeliverer) InitializeCallCount() int {
	fake.initializeMutex.RLock()
	defer fake.initializeMutex.RUnlock()
	return len(fake.initializeArgsForCall)
}

func (fake *BFTBlockDeliverer) InitializeCalls(stub func(*common.Config, string)) {
	fake.initializeMutex.Lock()
	defer fake.initializeMutex.Unlock()
	fake.InitializeStub = stub
}

func (fake *BFTBlockDeliverer) InitializeArgsForCall(i int) (*common.Config, string) {
	fake.initializeMutex.RLock()
	defer fake.initializeMutex.RUnlock()
	argsForCall := fake.initializeArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

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

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

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

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

func (fake *BFTBlockDeliverer) 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 _ smartbft.BFTBlockDeliverer = new(BFTBlockDeliverer)
