1 Star 0 Fork 0

妥協/fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fabric_tx_submitter.go 2.87 KB
一键复制 编辑 原始数据 按行查看 历史
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
sync "sync"
client "github.com/hyperledger/fabric/token/client"
)
type FabricTxSubmitter struct {
SubmitStub func([]byte) error
submitMutex sync.RWMutex
submitArgsForCall []struct {
arg1 []byte
}
submitReturns struct {
result1 error
}
submitReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FabricTxSubmitter) Submit(arg1 []byte) error {
var arg1Copy []byte
if arg1 != nil {
arg1Copy = make([]byte, len(arg1))
copy(arg1Copy, arg1)
}
fake.submitMutex.Lock()
ret, specificReturn := fake.submitReturnsOnCall[len(fake.submitArgsForCall)]
fake.submitArgsForCall = append(fake.submitArgsForCall, struct {
arg1 []byte
}{arg1Copy})
fake.recordInvocation("Submit", []interface{}{arg1Copy})
fake.submitMutex.Unlock()
if fake.SubmitStub != nil {
return fake.SubmitStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.submitReturns
return fakeReturns.result1
}
func (fake *FabricTxSubmitter) SubmitCallCount() int {
fake.submitMutex.RLock()
defer fake.submitMutex.RUnlock()
return len(fake.submitArgsForCall)
}
func (fake *FabricTxSubmitter) SubmitCalls(stub func([]byte) error) {
fake.submitMutex.Lock()
defer fake.submitMutex.Unlock()
fake.SubmitStub = stub
}
func (fake *FabricTxSubmitter) SubmitArgsForCall(i int) []byte {
fake.submitMutex.RLock()
defer fake.submitMutex.RUnlock()
argsForCall := fake.submitArgsForCall[i]
return argsForCall.arg1
}
func (fake *FabricTxSubmitter) SubmitReturns(result1 error) {
fake.submitMutex.Lock()
defer fake.submitMutex.Unlock()
fake.SubmitStub = nil
fake.submitReturns = struct {
result1 error
}{result1}
}
func (fake *FabricTxSubmitter) SubmitReturnsOnCall(i int, result1 error) {
fake.submitMutex.Lock()
defer fake.submitMutex.Unlock()
fake.SubmitStub = nil
if fake.submitReturnsOnCall == nil {
fake.submitReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.submitReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FabricTxSubmitter) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.submitMutex.RLock()
defer fake.submitMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FabricTxSubmitter) 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 _ client.FabricTxSubmitter = new(FabricTxSubmitter)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liurenhao/fabric.git
git@gitee.com:liurenhao/fabric.git
liurenhao
fabric
fabric
v1.4.4

搜索帮助

0d507c66 1850385 C8b1a773 1850385