github.com/lzy4123/fabric@v2.1.1+incompatible/bccsp/idemix/handlers/mock/issuer_secret_key.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mock 3 4 import ( 5 "sync" 6 7 "github.com/hyperledger/fabric/bccsp/idemix/handlers" 8 ) 9 10 type IssuerSecretKey struct { 11 BytesStub func() ([]byte, error) 12 bytesMutex sync.RWMutex 13 bytesArgsForCall []struct { 14 } 15 bytesReturns struct { 16 result1 []byte 17 result2 error 18 } 19 bytesReturnsOnCall map[int]struct { 20 result1 []byte 21 result2 error 22 } 23 PublicStub func() handlers.IssuerPublicKey 24 publicMutex sync.RWMutex 25 publicArgsForCall []struct { 26 } 27 publicReturns struct { 28 result1 handlers.IssuerPublicKey 29 } 30 publicReturnsOnCall map[int]struct { 31 result1 handlers.IssuerPublicKey 32 } 33 invocations map[string][][]interface{} 34 invocationsMutex sync.RWMutex 35 } 36 37 func (fake *IssuerSecretKey) Bytes() ([]byte, error) { 38 fake.bytesMutex.Lock() 39 ret, specificReturn := fake.bytesReturnsOnCall[len(fake.bytesArgsForCall)] 40 fake.bytesArgsForCall = append(fake.bytesArgsForCall, struct { 41 }{}) 42 fake.recordInvocation("Bytes", []interface{}{}) 43 fake.bytesMutex.Unlock() 44 if fake.BytesStub != nil { 45 return fake.BytesStub() 46 } 47 if specificReturn { 48 return ret.result1, ret.result2 49 } 50 fakeReturns := fake.bytesReturns 51 return fakeReturns.result1, fakeReturns.result2 52 } 53 54 func (fake *IssuerSecretKey) BytesCallCount() int { 55 fake.bytesMutex.RLock() 56 defer fake.bytesMutex.RUnlock() 57 return len(fake.bytesArgsForCall) 58 } 59 60 func (fake *IssuerSecretKey) BytesCalls(stub func() ([]byte, error)) { 61 fake.bytesMutex.Lock() 62 defer fake.bytesMutex.Unlock() 63 fake.BytesStub = stub 64 } 65 66 func (fake *IssuerSecretKey) BytesReturns(result1 []byte, result2 error) { 67 fake.bytesMutex.Lock() 68 defer fake.bytesMutex.Unlock() 69 fake.BytesStub = nil 70 fake.bytesReturns = struct { 71 result1 []byte 72 result2 error 73 }{result1, result2} 74 } 75 76 func (fake *IssuerSecretKey) BytesReturnsOnCall(i int, result1 []byte, result2 error) { 77 fake.bytesMutex.Lock() 78 defer fake.bytesMutex.Unlock() 79 fake.BytesStub = nil 80 if fake.bytesReturnsOnCall == nil { 81 fake.bytesReturnsOnCall = make(map[int]struct { 82 result1 []byte 83 result2 error 84 }) 85 } 86 fake.bytesReturnsOnCall[i] = struct { 87 result1 []byte 88 result2 error 89 }{result1, result2} 90 } 91 92 func (fake *IssuerSecretKey) Public() handlers.IssuerPublicKey { 93 fake.publicMutex.Lock() 94 ret, specificReturn := fake.publicReturnsOnCall[len(fake.publicArgsForCall)] 95 fake.publicArgsForCall = append(fake.publicArgsForCall, struct { 96 }{}) 97 fake.recordInvocation("Public", []interface{}{}) 98 fake.publicMutex.Unlock() 99 if fake.PublicStub != nil { 100 return fake.PublicStub() 101 } 102 if specificReturn { 103 return ret.result1 104 } 105 fakeReturns := fake.publicReturns 106 return fakeReturns.result1 107 } 108 109 func (fake *IssuerSecretKey) PublicCallCount() int { 110 fake.publicMutex.RLock() 111 defer fake.publicMutex.RUnlock() 112 return len(fake.publicArgsForCall) 113 } 114 115 func (fake *IssuerSecretKey) PublicCalls(stub func() handlers.IssuerPublicKey) { 116 fake.publicMutex.Lock() 117 defer fake.publicMutex.Unlock() 118 fake.PublicStub = stub 119 } 120 121 func (fake *IssuerSecretKey) PublicReturns(result1 handlers.IssuerPublicKey) { 122 fake.publicMutex.Lock() 123 defer fake.publicMutex.Unlock() 124 fake.PublicStub = nil 125 fake.publicReturns = struct { 126 result1 handlers.IssuerPublicKey 127 }{result1} 128 } 129 130 func (fake *IssuerSecretKey) PublicReturnsOnCall(i int, result1 handlers.IssuerPublicKey) { 131 fake.publicMutex.Lock() 132 defer fake.publicMutex.Unlock() 133 fake.PublicStub = nil 134 if fake.publicReturnsOnCall == nil { 135 fake.publicReturnsOnCall = make(map[int]struct { 136 result1 handlers.IssuerPublicKey 137 }) 138 } 139 fake.publicReturnsOnCall[i] = struct { 140 result1 handlers.IssuerPublicKey 141 }{result1} 142 } 143 144 func (fake *IssuerSecretKey) Invocations() map[string][][]interface{} { 145 fake.invocationsMutex.RLock() 146 defer fake.invocationsMutex.RUnlock() 147 fake.bytesMutex.RLock() 148 defer fake.bytesMutex.RUnlock() 149 fake.publicMutex.RLock() 150 defer fake.publicMutex.RUnlock() 151 copiedInvocations := map[string][][]interface{}{} 152 for key, value := range fake.invocations { 153 copiedInvocations[key] = value 154 } 155 return copiedInvocations 156 } 157 158 func (fake *IssuerSecretKey) recordInvocation(key string, args []interface{}) { 159 fake.invocationsMutex.Lock() 160 defer fake.invocationsMutex.Unlock() 161 if fake.invocations == nil { 162 fake.invocations = map[string][][]interface{}{} 163 } 164 if fake.invocations[key] == nil { 165 fake.invocations[key] = [][]interface{}{} 166 } 167 fake.invocations[key] = append(fake.invocations[key], args) 168 } 169 170 var _ handlers.IssuerSecretKey = new(IssuerSecretKey)