1 Star 0 Fork 0

13683679291/fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
signer.go 4.56 KB
一键复制 编辑 原始数据 按行查看 历史
Jason Yellick 提交于 2019-09-09 11:07 . FAB-7559 Reimplement blocksprovider
// Code generated by counterfeiter. DO NOT EDIT.
package fake
import (
"sync"
)
type Signer struct {
SerializeStub func() ([]byte, error)
serializeMutex sync.RWMutex
serializeArgsForCall []struct {
}
serializeReturns struct {
result1 []byte
result2 error
}
serializeReturnsOnCall map[int]struct {
result1 []byte
result2 error
}
SignStub func([]byte) ([]byte, error)
signMutex sync.RWMutex
signArgsForCall []struct {
arg1 []byte
}
signReturns struct {
result1 []byte
result2 error
}
signReturnsOnCall map[int]struct {
result1 []byte
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *Signer) Serialize() ([]byte, error) {
fake.serializeMutex.Lock()
ret, specificReturn := fake.serializeReturnsOnCall[len(fake.serializeArgsForCall)]
fake.serializeArgsForCall = append(fake.serializeArgsForCall, struct {
}{})
fake.recordInvocation("Serialize", []interface{}{})
fake.serializeMutex.Unlock()
if fake.SerializeStub != nil {
return fake.SerializeStub()
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.serializeReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *Signer) SerializeCallCount() int {
fake.serializeMutex.RLock()
defer fake.serializeMutex.RUnlock()
return len(fake.serializeArgsForCall)
}
func (fake *Signer) SerializeCalls(stub func() ([]byte, error)) {
fake.serializeMutex.Lock()
defer fake.serializeMutex.Unlock()
fake.SerializeStub = stub
}
func (fake *Signer) SerializeReturns(result1 []byte, result2 error) {
fake.serializeMutex.Lock()
defer fake.serializeMutex.Unlock()
fake.SerializeStub = nil
fake.serializeReturns = struct {
result1 []byte
result2 error
}{result1, result2}
}
func (fake *Signer) SerializeReturnsOnCall(i int, result1 []byte, result2 error) {
fake.serializeMutex.Lock()
defer fake.serializeMutex.Unlock()
fake.SerializeStub = nil
if fake.serializeReturnsOnCall == nil {
fake.serializeReturnsOnCall = make(map[int]struct {
result1 []byte
result2 error
})
}
fake.serializeReturnsOnCall[i] = struct {
result1 []byte
result2 error
}{result1, result2}
}
func (fake *Signer) Sign(arg1 []byte) ([]byte, error) {
var arg1Copy []byte
if arg1 != nil {
arg1Copy = make([]byte, len(arg1))
copy(arg1Copy, arg1)
}
fake.signMutex.Lock()
ret, specificReturn := fake.signReturnsOnCall[len(fake.signArgsForCall)]
fake.signArgsForCall = append(fake.signArgsForCall, struct {
arg1 []byte
}{arg1Copy})
fake.recordInvocation("Sign", []interface{}{arg1Copy})
fake.signMutex.Unlock()
if fake.SignStub != nil {
return fake.SignStub(arg1)
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.signReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *Signer) SignCallCount() int {
fake.signMutex.RLock()
defer fake.signMutex.RUnlock()
return len(fake.signArgsForCall)
}
func (fake *Signer) SignCalls(stub func([]byte) ([]byte, error)) {
fake.signMutex.Lock()
defer fake.signMutex.Unlock()
fake.SignStub = stub
}
func (fake *Signer) SignArgsForCall(i int) []byte {
fake.signMutex.RLock()
defer fake.signMutex.RUnlock()
argsForCall := fake.signArgsForCall[i]
return argsForCall.arg1
}
func (fake *Signer) SignReturns(result1 []byte, result2 error) {
fake.signMutex.Lock()
defer fake.signMutex.Unlock()
fake.SignStub = nil
fake.signReturns = struct {
result1 []byte
result2 error
}{result1, result2}
}
func (fake *Signer) SignReturnsOnCall(i int, result1 []byte, result2 error) {
fake.signMutex.Lock()
defer fake.signMutex.Unlock()
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 *Signer) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.serializeMutex.RLock()
defer fake.serializeMutex.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 *Signer) 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/mmcro/fabric.git
git@gitee.com:mmcro/fabric.git
mmcro
fabric
fabric
v2.0.1

搜索帮助