github.com/lzy4123/fabric@v2.1.1+incompatible/bccsp/idemix/handlers/mock/big.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 Big 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 invocations map[string][][]interface{} 24 invocationsMutex sync.RWMutex 25 } 26 27 func (fake *Big) Bytes() ([]byte, error) { 28 fake.bytesMutex.Lock() 29 ret, specificReturn := fake.bytesReturnsOnCall[len(fake.bytesArgsForCall)] 30 fake.bytesArgsForCall = append(fake.bytesArgsForCall, struct { 31 }{}) 32 fake.recordInvocation("Bytes", []interface{}{}) 33 fake.bytesMutex.Unlock() 34 if fake.BytesStub != nil { 35 return fake.BytesStub() 36 } 37 if specificReturn { 38 return ret.result1, ret.result2 39 } 40 fakeReturns := fake.bytesReturns 41 return fakeReturns.result1, fakeReturns.result2 42 } 43 44 func (fake *Big) BytesCallCount() int { 45 fake.bytesMutex.RLock() 46 defer fake.bytesMutex.RUnlock() 47 return len(fake.bytesArgsForCall) 48 } 49 50 func (fake *Big) BytesCalls(stub func() ([]byte, error)) { 51 fake.bytesMutex.Lock() 52 defer fake.bytesMutex.Unlock() 53 fake.BytesStub = stub 54 } 55 56 func (fake *Big) BytesReturns(result1 []byte, result2 error) { 57 fake.bytesMutex.Lock() 58 defer fake.bytesMutex.Unlock() 59 fake.BytesStub = nil 60 fake.bytesReturns = struct { 61 result1 []byte 62 result2 error 63 }{result1, result2} 64 } 65 66 func (fake *Big) BytesReturnsOnCall(i int, result1 []byte, result2 error) { 67 fake.bytesMutex.Lock() 68 defer fake.bytesMutex.Unlock() 69 fake.BytesStub = nil 70 if fake.bytesReturnsOnCall == nil { 71 fake.bytesReturnsOnCall = make(map[int]struct { 72 result1 []byte 73 result2 error 74 }) 75 } 76 fake.bytesReturnsOnCall[i] = struct { 77 result1 []byte 78 result2 error 79 }{result1, result2} 80 } 81 82 func (fake *Big) Invocations() map[string][][]interface{} { 83 fake.invocationsMutex.RLock() 84 defer fake.invocationsMutex.RUnlock() 85 fake.bytesMutex.RLock() 86 defer fake.bytesMutex.RUnlock() 87 copiedInvocations := map[string][][]interface{}{} 88 for key, value := range fake.invocations { 89 copiedInvocations[key] = value 90 } 91 return copiedInvocations 92 } 93 94 func (fake *Big) recordInvocation(key string, args []interface{}) { 95 fake.invocationsMutex.Lock() 96 defer fake.invocationsMutex.Unlock() 97 if fake.invocations == nil { 98 fake.invocations = map[string][][]interface{}{} 99 } 100 if fake.invocations[key] == nil { 101 fake.invocations[key] = [][]interface{}{} 102 } 103 fake.invocations[key] = append(fake.invocations[key], args) 104 } 105 106 var _ handlers.Big = new(Big)