63 Star 181 Fork 3

Gitee 极速下载 / hyperledger-fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/hyperledger/fabric
克隆/下载
state_listener.go 8.76 KB
一键复制 编辑 原始数据 按行查看 历史
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
"sync"
"github.com/hyperledger/fabric/core/ledger"
)
type StateListener struct {
HandleStateUpdatesStub func(*ledger.StateUpdateTrigger) error
handleStateUpdatesMutex sync.RWMutex
handleStateUpdatesArgsForCall []struct {
arg1 *ledger.StateUpdateTrigger
}
handleStateUpdatesReturns struct {
result1 error
}
handleStateUpdatesReturnsOnCall map[int]struct {
result1 error
}
InitializeStub func(string, ledger.SimpleQueryExecutor) error
initializeMutex sync.RWMutex
initializeArgsForCall []struct {
arg1 string
arg2 ledger.SimpleQueryExecutor
}
initializeReturns struct {
result1 error
}
initializeReturnsOnCall map[int]struct {
result1 error
}
InterestedInNamespacesStub func() []string
interestedInNamespacesMutex sync.RWMutex
interestedInNamespacesArgsForCall []struct {
}
interestedInNamespacesReturns struct {
result1 []string
}
interestedInNamespacesReturnsOnCall map[int]struct {
result1 []string
}
StateCommitDoneStub func(string)
stateCommitDoneMutex sync.RWMutex
stateCommitDoneArgsForCall []struct {
arg1 string
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *StateListener) HandleStateUpdates(arg1 *ledger.StateUpdateTrigger) error {
fake.handleStateUpdatesMutex.Lock()
ret, specificReturn := fake.handleStateUpdatesReturnsOnCall[len(fake.handleStateUpdatesArgsForCall)]
fake.handleStateUpdatesArgsForCall = append(fake.handleStateUpdatesArgsForCall, struct {
arg1 *ledger.StateUpdateTrigger
}{arg1})
fake.recordInvocation("HandleStateUpdates", []interface{}{arg1})
fake.handleStateUpdatesMutex.Unlock()
if fake.HandleStateUpdatesStub != nil {
return fake.HandleStateUpdatesStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.handleStateUpdatesReturns
return fakeReturns.result1
}
func (fake *StateListener) HandleStateUpdatesCallCount() int {
fake.handleStateUpdatesMutex.RLock()
defer fake.handleStateUpdatesMutex.RUnlock()
return len(fake.handleStateUpdatesArgsForCall)
}
func (fake *StateListener) HandleStateUpdatesCalls(stub func(*ledger.StateUpdateTrigger) error) {
fake.handleStateUpdatesMutex.Lock()
defer fake.handleStateUpdatesMutex.Unlock()
fake.HandleStateUpdatesStub = stub
}
func (fake *StateListener) HandleStateUpdatesArgsForCall(i int) *ledger.StateUpdateTrigger {
fake.handleStateUpdatesMutex.RLock()
defer fake.handleStateUpdatesMutex.RUnlock()
argsForCall := fake.handleStateUpdatesArgsForCall[i]
return argsForCall.arg1
}
func (fake *StateListener) HandleStateUpdatesReturns(result1 error) {
fake.handleStateUpdatesMutex.Lock()
defer fake.handleStateUpdatesMutex.Unlock()
fake.HandleStateUpdatesStub = nil
fake.handleStateUpdatesReturns = struct {
result1 error
}{result1}
}
func (fake *StateListener) HandleStateUpdatesReturnsOnCall(i int, result1 error) {
fake.handleStateUpdatesMutex.Lock()
defer fake.handleStateUpdatesMutex.Unlock()
fake.HandleStateUpdatesStub = nil
if fake.handleStateUpdatesReturnsOnCall == nil {
fake.handleStateUpdatesReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.handleStateUpdatesReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *StateListener) Initialize(arg1 string, arg2 ledger.SimpleQueryExecutor) error {
fake.initializeMutex.Lock()
ret, specificReturn := fake.initializeReturnsOnCall[len(fake.initializeArgsForCall)]
fake.initializeArgsForCall = append(fake.initializeArgsForCall, struct {
arg1 string
arg2 ledger.SimpleQueryExecutor
}{arg1, arg2})
fake.recordInvocation("Initialize", []interface{}{arg1, arg2})
fake.initializeMutex.Unlock()
if fake.InitializeStub != nil {
return fake.InitializeStub(arg1, arg2)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.initializeReturns
return fakeReturns.result1
}
func (fake *StateListener) InitializeCallCount() int {
fake.initializeMutex.RLock()
defer fake.initializeMutex.RUnlock()
return len(fake.initializeArgsForCall)
}
func (fake *StateListener) InitializeCalls(stub func(string, ledger.SimpleQueryExecutor) error) {
fake.initializeMutex.Lock()
defer fake.initializeMutex.Unlock()
fake.InitializeStub = stub
}
func (fake *StateListener) InitializeArgsForCall(i int) (string, ledger.SimpleQueryExecutor) {
fake.initializeMutex.RLock()
defer fake.initializeMutex.RUnlock()
argsForCall := fake.initializeArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *StateListener) InitializeReturns(result1 error) {
fake.initializeMutex.Lock()
defer fake.initializeMutex.Unlock()
fake.InitializeStub = nil
fake.initializeReturns = struct {
result1 error
}{result1}
}
func (fake *StateListener) InitializeReturnsOnCall(i int, result1 error) {
fake.initializeMutex.Lock()
defer fake.initializeMutex.Unlock()
fake.InitializeStub = nil
if fake.initializeReturnsOnCall == nil {
fake.initializeReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.initializeReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *StateListener) InterestedInNamespaces() []string {
fake.interestedInNamespacesMutex.Lock()
ret, specificReturn := fake.interestedInNamespacesReturnsOnCall[len(fake.interestedInNamespacesArgsForCall)]
fake.interestedInNamespacesArgsForCall = append(fake.interestedInNamespacesArgsForCall, struct {
}{})
fake.recordInvocation("InterestedInNamespaces", []interface{}{})
fake.interestedInNamespacesMutex.Unlock()
if fake.InterestedInNamespacesStub != nil {
return fake.InterestedInNamespacesStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.interestedInNamespacesReturns
return fakeReturns.result1
}
func (fake *StateListener) InterestedInNamespacesCallCount() int {
fake.interestedInNamespacesMutex.RLock()
defer fake.interestedInNamespacesMutex.RUnlock()
return len(fake.interestedInNamespacesArgsForCall)
}
func (fake *StateListener) InterestedInNamespacesCalls(stub func() []string) {
fake.interestedInNamespacesMutex.Lock()
defer fake.interestedInNamespacesMutex.Unlock()
fake.InterestedInNamespacesStub = stub
}
func (fake *StateListener) InterestedInNamespacesReturns(result1 []string) {
fake.interestedInNamespacesMutex.Lock()
defer fake.interestedInNamespacesMutex.Unlock()
fake.InterestedInNamespacesStub = nil
fake.interestedInNamespacesReturns = struct {
result1 []string
}{result1}
}
func (fake *StateListener) InterestedInNamespacesReturnsOnCall(i int, result1 []string) {
fake.interestedInNamespacesMutex.Lock()
defer fake.interestedInNamespacesMutex.Unlock()
fake.InterestedInNamespacesStub = nil
if fake.interestedInNamespacesReturnsOnCall == nil {
fake.interestedInNamespacesReturnsOnCall = make(map[int]struct {
result1 []string
})
}
fake.interestedInNamespacesReturnsOnCall[i] = struct {
result1 []string
}{result1}
}
func (fake *StateListener) StateCommitDone(arg1 string) {
fake.stateCommitDoneMutex.Lock()
fake.stateCommitDoneArgsForCall = append(fake.stateCommitDoneArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("StateCommitDone", []interface{}{arg1})
fake.stateCommitDoneMutex.Unlock()
if fake.StateCommitDoneStub != nil {
fake.StateCommitDoneStub(arg1)
}
}
func (fake *StateListener) StateCommitDoneCallCount() int {
fake.stateCommitDoneMutex.RLock()
defer fake.stateCommitDoneMutex.RUnlock()
return len(fake.stateCommitDoneArgsForCall)
}
func (fake *StateListener) StateCommitDoneCalls(stub func(string)) {
fake.stateCommitDoneMutex.Lock()
defer fake.stateCommitDoneMutex.Unlock()
fake.StateCommitDoneStub = stub
}
func (fake *StateListener) StateCommitDoneArgsForCall(i int) string {
fake.stateCommitDoneMutex.RLock()
defer fake.stateCommitDoneMutex.RUnlock()
argsForCall := fake.stateCommitDoneArgsForCall[i]
return argsForCall.arg1
}
func (fake *StateListener) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.handleStateUpdatesMutex.RLock()
defer fake.handleStateUpdatesMutex.RUnlock()
fake.initializeMutex.RLock()
defer fake.initializeMutex.RUnlock()
fake.interestedInNamespacesMutex.RLock()
defer fake.interestedInNamespacesMutex.RUnlock()
fake.stateCommitDoneMutex.RLock()
defer fake.stateCommitDoneMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *StateListener) 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 _ ledger.StateListener = new(StateListener)
Go
1
https://gitee.com/mirrors/hyperledger-fabric.git
git@gitee.com:mirrors/hyperledger-fabric.git
mirrors
hyperledger-fabric
hyperledger-fabric
v2.1.1

搜索帮助