github.com/kaituanwang/hyperledger@v2.0.1+incompatible/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/hyperledger/fabric/bccsp/idemix/handlers"
     8  )
     9  
    10  type IssuerPublicKey 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  	HashStub        func() []byte
    24  	hashMutex       sync.RWMutex
    25  	hashArgsForCall []struct {
    26  	}
    27  	hashReturns struct {
    28  		result1 []byte
    29  	}
    30  	hashReturnsOnCall map[int]struct {
    31  		result1 []byte
    32  	}
    33  	invocations      map[string][][]interface{}
    34  	invocationsMutex sync.RWMutex
    35  }
    36  
    37  func (fake *IssuerPublicKey) 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 *IssuerPublicKey) BytesCallCount() int {
    55  	fake.bytesMutex.RLock()
    56  	defer fake.bytesMutex.RUnlock()
    57  	return len(fake.bytesArgsForCall)
    58  }
    59  
    60  func (fake *IssuerPublicKey) BytesCalls(stub func() ([]byte, error)) {
    61  	fake.bytesMutex.Lock()
    62  	defer fake.bytesMutex.Unlock()
    63  	fake.BytesStub = stub
    64  }
    65  
    66  func (fake *IssuerPublicKey) 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 *IssuerPublicKey) 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 *IssuerPublicKey) Hash() []byte {
    93  	fake.hashMutex.Lock()
    94  	ret, specificReturn := fake.hashReturnsOnCall[len(fake.hashArgsForCall)]
    95  	fake.hashArgsForCall = append(fake.hashArgsForCall, struct {
    96  	}{})
    97  	fake.recordInvocation("Hash", []interface{}{})
    98  	fake.hashMutex.Unlock()
    99  	if fake.HashStub != nil {
   100  		return fake.HashStub()
   101  	}
   102  	if specificReturn {
   103  		return ret.result1
   104  	}
   105  	fakeReturns := fake.hashReturns
   106  	return fakeReturns.result1
   107  }
   108  
   109  func (fake *IssuerPublicKey) HashCallCount() int {
   110  	fake.hashMutex.RLock()
   111  	defer fake.hashMutex.RUnlock()
   112  	return len(fake.hashArgsForCall)
   113  }
   114  
   115  func (fake *IssuerPublicKey) HashCalls(stub func() []byte) {
   116  	fake.hashMutex.Lock()
   117  	defer fake.hashMutex.Unlock()
   118  	fake.HashStub = stub
   119  }
   120  
   121  func (fake *IssuerPublicKey) HashReturns(result1 []byte) {
   122  	fake.hashMutex.Lock()
   123  	defer fake.hashMutex.Unlock()
   124  	fake.HashStub = nil
   125  	fake.hashReturns = struct {
   126  		result1 []byte
   127  	}{result1}
   128  }
   129  
   130  func (fake *IssuerPublicKey) HashReturnsOnCall(i int, result1 []byte) {
   131  	fake.hashMutex.Lock()
   132  	defer fake.hashMutex.Unlock()
   133  	fake.HashStub = nil
   134  	if fake.hashReturnsOnCall == nil {
   135  		fake.hashReturnsOnCall = make(map[int]struct {
   136  			result1 []byte
   137  		})
   138  	}
   139  	fake.hashReturnsOnCall[i] = struct {
   140  		result1 []byte
   141  	}{result1}
   142  }
   143  
   144  func (fake *IssuerPublicKey) Invocations() map[string][][]interface{} {
   145  	fake.invocationsMutex.RLock()
   146  	defer fake.invocationsMutex.RUnlock()
   147  	fake.bytesMutex.RLock()
   148  	defer fake.bytesMutex.RUnlock()
   149  	fake.hashMutex.RLock()
   150  	defer fake.hashMutex.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 *IssuerPublicKey) 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.IssuerPublicKey = new(IssuerPublicKey)