1 Star 0 Fork 0

peter / fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
collection_policy_checker.go 4.44 KB
一键复制 编辑 原始数据 按行查看 历史
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
"sync"
"github.com/hyperledger/fabric/core/ledger"
"github.com/hyperledger/fabric/msp"
"github.com/hyperledger/fabric/protoutil"
)
type CollectionPolicyChecker struct {
CheckCollectionPolicyStub func(uint64, string, string, ledger.ConfigHistoryRetriever, msp.IdentityDeserializer, *protoutil.SignedData) (bool, error)
checkCollectionPolicyMutex sync.RWMutex
checkCollectionPolicyArgsForCall []struct {
arg1 uint64
arg2 string
arg3 string
arg4 ledger.ConfigHistoryRetriever
arg5 msp.IdentityDeserializer
arg6 *protoutil.SignedData
}
checkCollectionPolicyReturns struct {
result1 bool
result2 error
}
checkCollectionPolicyReturnsOnCall map[int]struct {
result1 bool
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *CollectionPolicyChecker) CheckCollectionPolicy(arg1 uint64, arg2 string, arg3 string, arg4 ledger.ConfigHistoryRetriever, arg5 msp.IdentityDeserializer, arg6 *protoutil.SignedData) (bool, error) {
fake.checkCollectionPolicyMutex.Lock()
ret, specificReturn := fake.checkCollectionPolicyReturnsOnCall[len(fake.checkCollectionPolicyArgsForCall)]
fake.checkCollectionPolicyArgsForCall = append(fake.checkCollectionPolicyArgsForCall, struct {
arg1 uint64
arg2 string
arg3 string
arg4 ledger.ConfigHistoryRetriever
arg5 msp.IdentityDeserializer
arg6 *protoutil.SignedData
}{arg1, arg2, arg3, arg4, arg5, arg6})
fake.recordInvocation("CheckCollectionPolicy", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6})
fake.checkCollectionPolicyMutex.Unlock()
if fake.CheckCollectionPolicyStub != nil {
return fake.CheckCollectionPolicyStub(arg1, arg2, arg3, arg4, arg5, arg6)
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.checkCollectionPolicyReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *CollectionPolicyChecker) CheckCollectionPolicyCallCount() int {
fake.checkCollectionPolicyMutex.RLock()
defer fake.checkCollectionPolicyMutex.RUnlock()
return len(fake.checkCollectionPolicyArgsForCall)
}
func (fake *CollectionPolicyChecker) CheckCollectionPolicyCalls(stub func(uint64, string, string, ledger.ConfigHistoryRetriever, msp.IdentityDeserializer, *protoutil.SignedData) (bool, error)) {
fake.checkCollectionPolicyMutex.Lock()
defer fake.checkCollectionPolicyMutex.Unlock()
fake.CheckCollectionPolicyStub = stub
}
func (fake *CollectionPolicyChecker) CheckCollectionPolicyArgsForCall(i int) (uint64, string, string, ledger.ConfigHistoryRetriever, msp.IdentityDeserializer, *protoutil.SignedData) {
fake.checkCollectionPolicyMutex.RLock()
defer fake.checkCollectionPolicyMutex.RUnlock()
argsForCall := fake.checkCollectionPolicyArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6
}
func (fake *CollectionPolicyChecker) CheckCollectionPolicyReturns(result1 bool, result2 error) {
fake.checkCollectionPolicyMutex.Lock()
defer fake.checkCollectionPolicyMutex.Unlock()
fake.CheckCollectionPolicyStub = nil
fake.checkCollectionPolicyReturns = struct {
result1 bool
result2 error
}{result1, result2}
}
func (fake *CollectionPolicyChecker) CheckCollectionPolicyReturnsOnCall(i int, result1 bool, result2 error) {
fake.checkCollectionPolicyMutex.Lock()
defer fake.checkCollectionPolicyMutex.Unlock()
fake.CheckCollectionPolicyStub = nil
if fake.checkCollectionPolicyReturnsOnCall == nil {
fake.checkCollectionPolicyReturnsOnCall = make(map[int]struct {
result1 bool
result2 error
})
}
fake.checkCollectionPolicyReturnsOnCall[i] = struct {
result1 bool
result2 error
}{result1, result2}
}
func (fake *CollectionPolicyChecker) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.checkCollectionPolicyMutex.RLock()
defer fake.checkCollectionPolicyMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *CollectionPolicyChecker) 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)
}
1
https://gitee.com/peter_code_git/fabric.git
git@gitee.com:peter_code_git/fabric.git
peter_code_git
fabric
fabric
v2.1.1

搜索帮助

53164aa7 5694891 3bd8fe86 5694891