github.com/hellobchain/third_party@v0.0.0-20230331131523-deb0478a2e52/hyperledger/fabric/bccsp/idemix/handlers/mock/issuer_public_key.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mock 3 4 import ( 5 "sync" 6 7 "github.com/hellobchain/third_party/hyperledger/fabric/bccsp/idemix/handlers" 8 ) 9 10 type IssuerPublicKey struct { 11 BytesStub func() ([]byte, error) 12 bytesMutex sync.RWMutex 13 bytesArgsForCall []struct{} 14 bytesReturns struct { 15 result1 []byte 16 result2 error 17 } 18 bytesReturnsOnCall map[int]struct { 19 result1 []byte 20 result2 error 21 } 22 HashStub func() []byte 23 hashMutex sync.RWMutex 24 hashArgsForCall []struct{} 25 hashReturns struct { 26 result1 []byte 27 } 28 hashReturnsOnCall map[int]struct { 29 result1 []byte 30 } 31 invocations map[string][][]interface{} 32 invocationsMutex sync.RWMutex 33 } 34 35 func (fake *IssuerPublicKey) Bytes() ([]byte, error) { 36 fake.bytesMutex.Lock() 37 ret, specificReturn := fake.bytesReturnsOnCall[len(fake.bytesArgsForCall)] 38 fake.bytesArgsForCall = append(fake.bytesArgsForCall, struct{}{}) 39 fake.recordInvocation("Bytes", []interface{}{}) 40 fake.bytesMutex.Unlock() 41 if fake.BytesStub != nil { 42 return fake.BytesStub() 43 } 44 if specificReturn { 45 return ret.result1, ret.result2 46 } 47 return fake.bytesReturns.result1, fake.bytesReturns.result2 48 } 49 50 func (fake *IssuerPublicKey) BytesCallCount() int { 51 fake.bytesMutex.RLock() 52 defer fake.bytesMutex.RUnlock() 53 return len(fake.bytesArgsForCall) 54 } 55 56 func (fake *IssuerPublicKey) BytesReturns(result1 []byte, result2 error) { 57 fake.BytesStub = nil 58 fake.bytesReturns = struct { 59 result1 []byte 60 result2 error 61 }{result1, result2} 62 } 63 64 func (fake *IssuerPublicKey) BytesReturnsOnCall(i int, result1 []byte, result2 error) { 65 fake.BytesStub = nil 66 if fake.bytesReturnsOnCall == nil { 67 fake.bytesReturnsOnCall = make(map[int]struct { 68 result1 []byte 69 result2 error 70 }) 71 } 72 fake.bytesReturnsOnCall[i] = struct { 73 result1 []byte 74 result2 error 75 }{result1, result2} 76 } 77 78 func (fake *IssuerPublicKey) Hash() []byte { 79 fake.hashMutex.Lock() 80 ret, specificReturn := fake.hashReturnsOnCall[len(fake.hashArgsForCall)] 81 fake.hashArgsForCall = append(fake.hashArgsForCall, struct{}{}) 82 fake.recordInvocation("Hash", []interface{}{}) 83 fake.hashMutex.Unlock() 84 if fake.HashStub != nil { 85 return fake.HashStub() 86 } 87 if specificReturn { 88 return ret.result1 89 } 90 return fake.hashReturns.result1 91 } 92 93 func (fake *IssuerPublicKey) HashCallCount() int { 94 fake.hashMutex.RLock() 95 defer fake.hashMutex.RUnlock() 96 return len(fake.hashArgsForCall) 97 } 98 99 func (fake *IssuerPublicKey) HashReturns(result1 []byte) { 100 fake.HashStub = nil 101 fake.hashReturns = struct { 102 result1 []byte 103 }{result1} 104 } 105 106 func (fake *IssuerPublicKey) HashReturnsOnCall(i int, result1 []byte) { 107 fake.HashStub = nil 108 if fake.hashReturnsOnCall == nil { 109 fake.hashReturnsOnCall = make(map[int]struct { 110 result1 []byte 111 }) 112 } 113 fake.hashReturnsOnCall[i] = struct { 114 result1 []byte 115 }{result1} 116 } 117 118 func (fake *IssuerPublicKey) Invocations() map[string][][]interface{} { 119 fake.invocationsMutex.RLock() 120 defer fake.invocationsMutex.RUnlock() 121 fake.bytesMutex.RLock() 122 defer fake.bytesMutex.RUnlock() 123 fake.hashMutex.RLock() 124 defer fake.hashMutex.RUnlock() 125 copiedInvocations := map[string][][]interface{}{} 126 for key, value := range fake.invocations { 127 copiedInvocations[key] = value 128 } 129 return copiedInvocations 130 } 131 132 func (fake *IssuerPublicKey) recordInvocation(key string, args []interface{}) { 133 fake.invocationsMutex.Lock() 134 defer fake.invocationsMutex.Unlock() 135 if fake.invocations == nil { 136 fake.invocations = map[string][][]interface{}{} 137 } 138 if fake.invocations[key] == nil { 139 fake.invocations[key] = [][]interface{}{} 140 } 141 fake.invocations[key] = append(fake.invocations[key], args) 142 } 143 144 var _ handlers.IssuerPublicKey = new(IssuerPublicKey)