-
Notifications
You must be signed in to change notification settings - Fork 40
/
verifier.go
109 lines (97 loc) · 3.19 KB
/
verifier.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//此源码被清华学神尹成大魔王专业翻译分析并修改
//尹成QQ77025077
//尹成微信18510341407
//尹成所在QQ群721929980
//尹成邮箱 yinc13@mails.tsinghua.edu.cn
//尹成毕业于清华大学,微软区块链领域全球最有价值专家
//https://mvp.microsoft.com/zh-cn/PublicProfile/4033620
//伪造者生成的代码。不要编辑。
package mocks
import (
"sync"
"github.com/hyperledger/fabric/discovery/support/acl"
cb "github.com/hyperledger/fabric/protos/common"
)
type Verifier struct {
VerifyByChannelStub func(channel string, sd *cb.SignedData) error
verifyByChannelMutex sync.RWMutex
verifyByChannelArgsForCall []struct {
channel string
sd *cb.SignedData
}
verifyByChannelReturns struct {
result1 error
}
verifyByChannelReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *Verifier) VerifyByChannel(channel string, sd *cb.SignedData) error {
fake.verifyByChannelMutex.Lock()
ret, specificReturn := fake.verifyByChannelReturnsOnCall[len(fake.verifyByChannelArgsForCall)]
fake.verifyByChannelArgsForCall = append(fake.verifyByChannelArgsForCall, struct {
channel string
sd *cb.SignedData
}{channel, sd})
fake.recordInvocation("VerifyByChannel", []interface{}{channel, sd})
fake.verifyByChannelMutex.Unlock()
if fake.VerifyByChannelStub != nil {
return fake.VerifyByChannelStub(channel, sd)
}
if specificReturn {
return ret.result1
}
return fake.verifyByChannelReturns.result1
}
func (fake *Verifier) VerifyByChannelCallCount() int {
fake.verifyByChannelMutex.RLock()
defer fake.verifyByChannelMutex.RUnlock()
return len(fake.verifyByChannelArgsForCall)
}
func (fake *Verifier) VerifyByChannelArgsForCall(i int) (string, *cb.SignedData) {
fake.verifyByChannelMutex.RLock()
defer fake.verifyByChannelMutex.RUnlock()
return fake.verifyByChannelArgsForCall[i].channel, fake.verifyByChannelArgsForCall[i].sd
}
func (fake *Verifier) VerifyByChannelReturns(result1 error) {
fake.VerifyByChannelStub = nil
fake.verifyByChannelReturns = struct {
result1 error
}{result1}
}
func (fake *Verifier) VerifyByChannelReturnsOnCall(i int, result1 error) {
fake.VerifyByChannelStub = nil
if fake.verifyByChannelReturnsOnCall == nil {
fake.verifyByChannelReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.verifyByChannelReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *Verifier) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.verifyByChannelMutex.RLock()
defer fake.verifyByChannelMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *Verifier) 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 _ acl.Verifier = new(Verifier)