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