github.com/hellobchain/third_party@v0.0.0-20230331131523-deb0478a2e52/hyperledger/fabric/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/hellobchain/third_party/hyperledger/fabric/bccsp/idemix/handlers" 8 ) 9 10 type IssuerSecretKey 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 PublicStub func() handlers.IssuerPublicKey 23 publicMutex sync.RWMutex 24 publicArgsForCall []struct{} 25 publicReturns struct { 26 result1 handlers.IssuerPublicKey 27 } 28 publicReturnsOnCall map[int]struct { 29 result1 handlers.IssuerPublicKey 30 } 31 invocations map[string][][]interface{} 32 invocationsMutex sync.RWMutex 33 } 34 35 func (fake *IssuerSecretKey) 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 *IssuerSecretKey) BytesCallCount() int { 51 fake.bytesMutex.RLock() 52 defer fake.bytesMutex.RUnlock() 53 return len(fake.bytesArgsForCall) 54 } 55 56 func (fake *IssuerSecretKey) 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 *IssuerSecretKey) 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 *IssuerSecretKey) Public() handlers.IssuerPublicKey { 79 fake.publicMutex.Lock() 80 ret, specificReturn := fake.publicReturnsOnCall[len(fake.publicArgsForCall)] 81 fake.publicArgsForCall = append(fake.publicArgsForCall, struct{}{}) 82 fake.recordInvocation("Public", []interface{}{}) 83 fake.publicMutex.Unlock() 84 if fake.PublicStub != nil { 85 return fake.PublicStub() 86 } 87 if specificReturn { 88 return ret.result1 89 } 90 return fake.publicReturns.result1 91 } 92 93 func (fake *IssuerSecretKey) PublicCallCount() int { 94 fake.publicMutex.RLock() 95 defer fake.publicMutex.RUnlock() 96 return len(fake.publicArgsForCall) 97 } 98 99 func (fake *IssuerSecretKey) PublicReturns(result1 handlers.IssuerPublicKey) { 100 fake.PublicStub = nil 101 fake.publicReturns = struct { 102 result1 handlers.IssuerPublicKey 103 }{result1} 104 } 105 106 func (fake *IssuerSecretKey) PublicReturnsOnCall(i int, result1 handlers.IssuerPublicKey) { 107 fake.PublicStub = nil 108 if fake.publicReturnsOnCall == nil { 109 fake.publicReturnsOnCall = make(map[int]struct { 110 result1 handlers.IssuerPublicKey 111 }) 112 } 113 fake.publicReturnsOnCall[i] = struct { 114 result1 handlers.IssuerPublicKey 115 }{result1} 116 } 117 118 func (fake *IssuerSecretKey) Invocations() map[string][][]interface{} { 119 fake.invocationsMutex.RLock() 120 defer fake.invocationsMutex.RUnlock() 121 fake.bytesMutex.RLock() 122 defer fake.bytesMutex.RUnlock() 123 fake.publicMutex.RLock() 124 defer fake.publicMutex.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 *IssuerSecretKey) 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.IssuerSecretKey = new(IssuerSecretKey)