3 Star 6 Fork 7

Gitee 极速下载/Hyperledger fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/hyperledger/fabric
克隆/下载
local_signer.go 4.50 KB
一键复制 编辑 原始数据 按行查看 历史
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
"sync"
cb "github.com/hyperledger/fabric/protos/common"
)
type LocalSigner struct {
NewSignatureHeaderStub func() (*cb.SignatureHeader, error)
newSignatureHeaderMutex sync.RWMutex
newSignatureHeaderArgsForCall []struct{}
newSignatureHeaderReturns struct {
result1 *cb.SignatureHeader
result2 error
}
newSignatureHeaderReturnsOnCall map[int]struct {
result1 *cb.SignatureHeader
result2 error
}
SignStub func(message []byte) ([]byte, error)
signMutex sync.RWMutex
signArgsForCall []struct {
message []byte
}
signReturns struct {
result1 []byte
result2 error
}
signReturnsOnCall map[int]struct {
result1 []byte
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *LocalSigner) NewSignatureHeader() (*cb.SignatureHeader, error) {
fake.newSignatureHeaderMutex.Lock()
ret, specificReturn := fake.newSignatureHeaderReturnsOnCall[len(fake.newSignatureHeaderArgsForCall)]
fake.newSignatureHeaderArgsForCall = append(fake.newSignatureHeaderArgsForCall, struct{}{})
fake.recordInvocation("NewSignatureHeader", []interface{}{})
fake.newSignatureHeaderMutex.Unlock()
if fake.NewSignatureHeaderStub != nil {
return fake.NewSignatureHeaderStub()
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.newSignatureHeaderReturns.result1, fake.newSignatureHeaderReturns.result2
}
func (fake *LocalSigner) NewSignatureHeaderCallCount() int {
fake.newSignatureHeaderMutex.RLock()
defer fake.newSignatureHeaderMutex.RUnlock()
return len(fake.newSignatureHeaderArgsForCall)
}
func (fake *LocalSigner) NewSignatureHeaderReturns(result1 *cb.SignatureHeader, result2 error) {
fake.NewSignatureHeaderStub = nil
fake.newSignatureHeaderReturns = struct {
result1 *cb.SignatureHeader
result2 error
}{result1, result2}
}
func (fake *LocalSigner) NewSignatureHeaderReturnsOnCall(i int, result1 *cb.SignatureHeader, result2 error) {
fake.NewSignatureHeaderStub = nil
if fake.newSignatureHeaderReturnsOnCall == nil {
fake.newSignatureHeaderReturnsOnCall = make(map[int]struct {
result1 *cb.SignatureHeader
result2 error
})
}
fake.newSignatureHeaderReturnsOnCall[i] = struct {
result1 *cb.SignatureHeader
result2 error
}{result1, result2}
}
func (fake *LocalSigner) Sign(message []byte) ([]byte, error) {
var messageCopy []byte
if message != nil {
messageCopy = make([]byte, len(message))
copy(messageCopy, message)
}
fake.signMutex.Lock()
ret, specificReturn := fake.signReturnsOnCall[len(fake.signArgsForCall)]
fake.signArgsForCall = append(fake.signArgsForCall, struct {
message []byte
}{messageCopy})
fake.recordInvocation("Sign", []interface{}{messageCopy})
fake.signMutex.Unlock()
if fake.SignStub != nil {
return fake.SignStub(message)
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.signReturns.result1, fake.signReturns.result2
}
func (fake *LocalSigner) SignCallCount() int {
fake.signMutex.RLock()
defer fake.signMutex.RUnlock()
return len(fake.signArgsForCall)
}
func (fake *LocalSigner) SignArgsForCall(i int) []byte {
fake.signMutex.RLock()
defer fake.signMutex.RUnlock()
return fake.signArgsForCall[i].message
}
func (fake *LocalSigner) SignReturns(result1 []byte, result2 error) {
fake.SignStub = nil
fake.signReturns = struct {
result1 []byte
result2 error
}{result1, result2}
}
func (fake *LocalSigner) SignReturnsOnCall(i int, result1 []byte, result2 error) {
fake.SignStub = nil
if fake.signReturnsOnCall == nil {
fake.signReturnsOnCall = make(map[int]struct {
result1 []byte
result2 error
})
}
fake.signReturnsOnCall[i] = struct {
result1 []byte
result2 error
}{result1, result2}
}
func (fake *LocalSigner) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.newSignatureHeaderMutex.RLock()
defer fake.newSignatureHeaderMutex.RUnlock()
fake.signMutex.RLock()
defer fake.signMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *LocalSigner) 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
v1.4.5

搜索帮助