3 Star 6 Fork 7

Gitee 极速下载/Hyperledger fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/hyperledger/fabric
克隆/下载
chaincode_stream.go 4.50 KB
一键复制 编辑 原始数据 按行查看 历史
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
"sync"
"github.com/hyperledger/fabric-protos-go/peer"
)
type ChaincodeStream struct {
RecvStub func() (*peer.ChaincodeMessage, error)
recvMutex sync.RWMutex
recvArgsForCall []struct {
}
recvReturns struct {
result1 *peer.ChaincodeMessage
result2 error
}
recvReturnsOnCall map[int]struct {
result1 *peer.ChaincodeMessage
result2 error
}
SendStub func(*peer.ChaincodeMessage) error
sendMutex sync.RWMutex
sendArgsForCall []struct {
arg1 *peer.ChaincodeMessage
}
sendReturns struct {
result1 error
}
sendReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *ChaincodeStream) Recv() (*peer.ChaincodeMessage, error) {
fake.recvMutex.Lock()
ret, specificReturn := fake.recvReturnsOnCall[len(fake.recvArgsForCall)]
fake.recvArgsForCall = append(fake.recvArgsForCall, struct {
}{})
fake.recordInvocation("Recv", []interface{}{})
fake.recvMutex.Unlock()
if fake.RecvStub != nil {
return fake.RecvStub()
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.recvReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *ChaincodeStream) RecvCallCount() int {
fake.recvMutex.RLock()
defer fake.recvMutex.RUnlock()
return len(fake.recvArgsForCall)
}
func (fake *ChaincodeStream) RecvCalls(stub func() (*peer.ChaincodeMessage, error)) {
fake.recvMutex.Lock()
defer fake.recvMutex.Unlock()
fake.RecvStub = stub
}
func (fake *ChaincodeStream) RecvReturns(result1 *peer.ChaincodeMessage, result2 error) {
fake.recvMutex.Lock()
defer fake.recvMutex.Unlock()
fake.RecvStub = nil
fake.recvReturns = struct {
result1 *peer.ChaincodeMessage
result2 error
}{result1, result2}
}
func (fake *ChaincodeStream) RecvReturnsOnCall(i int, result1 *peer.ChaincodeMessage, result2 error) {
fake.recvMutex.Lock()
defer fake.recvMutex.Unlock()
fake.RecvStub = nil
if fake.recvReturnsOnCall == nil {
fake.recvReturnsOnCall = make(map[int]struct {
result1 *peer.ChaincodeMessage
result2 error
})
}
fake.recvReturnsOnCall[i] = struct {
result1 *peer.ChaincodeMessage
result2 error
}{result1, result2}
}
func (fake *ChaincodeStream) Send(arg1 *peer.ChaincodeMessage) error {
fake.sendMutex.Lock()
ret, specificReturn := fake.sendReturnsOnCall[len(fake.sendArgsForCall)]
fake.sendArgsForCall = append(fake.sendArgsForCall, struct {
arg1 *peer.ChaincodeMessage
}{arg1})
fake.recordInvocation("Send", []interface{}{arg1})
fake.sendMutex.Unlock()
if fake.SendStub != nil {
return fake.SendStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.sendReturns
return fakeReturns.result1
}
func (fake *ChaincodeStream) SendCallCount() int {
fake.sendMutex.RLock()
defer fake.sendMutex.RUnlock()
return len(fake.sendArgsForCall)
}
func (fake *ChaincodeStream) SendCalls(stub func(*peer.ChaincodeMessage) error) {
fake.sendMutex.Lock()
defer fake.sendMutex.Unlock()
fake.SendStub = stub
}
func (fake *ChaincodeStream) SendArgsForCall(i int) *peer.ChaincodeMessage {
fake.sendMutex.RLock()
defer fake.sendMutex.RUnlock()
argsForCall := fake.sendArgsForCall[i]
return argsForCall.arg1
}
func (fake *ChaincodeStream) SendReturns(result1 error) {
fake.sendMutex.Lock()
defer fake.sendMutex.Unlock()
fake.SendStub = nil
fake.sendReturns = struct {
result1 error
}{result1}
}
func (fake *ChaincodeStream) SendReturnsOnCall(i int, result1 error) {
fake.sendMutex.Lock()
defer fake.sendMutex.Unlock()
fake.SendStub = nil
if fake.sendReturnsOnCall == nil {
fake.sendReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.sendReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *ChaincodeStream) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.recvMutex.RLock()
defer fake.recvMutex.RUnlock()
fake.sendMutex.RLock()
defer fake.sendMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *ChaincodeStream) 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)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/fabric.git
git@gitee.com:mirrors/fabric.git
mirrors
fabric
Hyperledger fabric
v2.1.1

搜索帮助