github.com/anjalikarhana/fabric@v2.1.1+incompatible/orderer/common/msgprocessor/mocks/channel_config.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package mocks
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/hyperledger/fabric/common/channelconfig"
     8  )
     9  
    10  type ChannelConfig struct {
    11  	BlockDataHashingStructureWidthStub        func() uint32
    12  	blockDataHashingStructureWidthMutex       sync.RWMutex
    13  	blockDataHashingStructureWidthArgsForCall []struct {
    14  	}
    15  	blockDataHashingStructureWidthReturns struct {
    16  		result1 uint32
    17  	}
    18  	blockDataHashingStructureWidthReturnsOnCall map[int]struct {
    19  		result1 uint32
    20  	}
    21  	CapabilitiesStub        func() channelconfig.ChannelCapabilities
    22  	capabilitiesMutex       sync.RWMutex
    23  	capabilitiesArgsForCall []struct {
    24  	}
    25  	capabilitiesReturns struct {
    26  		result1 channelconfig.ChannelCapabilities
    27  	}
    28  	capabilitiesReturnsOnCall map[int]struct {
    29  		result1 channelconfig.ChannelCapabilities
    30  	}
    31  	HashingAlgorithmStub        func() func(input []byte) []byte
    32  	hashingAlgorithmMutex       sync.RWMutex
    33  	hashingAlgorithmArgsForCall []struct {
    34  	}
    35  	hashingAlgorithmReturns struct {
    36  		result1 func(input []byte) []byte
    37  	}
    38  	hashingAlgorithmReturnsOnCall map[int]struct {
    39  		result1 func(input []byte) []byte
    40  	}
    41  	OrdererAddressesStub        func() []string
    42  	ordererAddressesMutex       sync.RWMutex
    43  	ordererAddressesArgsForCall []struct {
    44  	}
    45  	ordererAddressesReturns struct {
    46  		result1 []string
    47  	}
    48  	ordererAddressesReturnsOnCall map[int]struct {
    49  		result1 []string
    50  	}
    51  	invocations      map[string][][]interface{}
    52  	invocationsMutex sync.RWMutex
    53  }
    54  
    55  func (fake *ChannelConfig) BlockDataHashingStructureWidth() uint32 {
    56  	fake.blockDataHashingStructureWidthMutex.Lock()
    57  	ret, specificReturn := fake.blockDataHashingStructureWidthReturnsOnCall[len(fake.blockDataHashingStructureWidthArgsForCall)]
    58  	fake.blockDataHashingStructureWidthArgsForCall = append(fake.blockDataHashingStructureWidthArgsForCall, struct {
    59  	}{})
    60  	fake.recordInvocation("BlockDataHashingStructureWidth", []interface{}{})
    61  	fake.blockDataHashingStructureWidthMutex.Unlock()
    62  	if fake.BlockDataHashingStructureWidthStub != nil {
    63  		return fake.BlockDataHashingStructureWidthStub()
    64  	}
    65  	if specificReturn {
    66  		return ret.result1
    67  	}
    68  	fakeReturns := fake.blockDataHashingStructureWidthReturns
    69  	return fakeReturns.result1
    70  }
    71  
    72  func (fake *ChannelConfig) BlockDataHashingStructureWidthCallCount() int {
    73  	fake.blockDataHashingStructureWidthMutex.RLock()
    74  	defer fake.blockDataHashingStructureWidthMutex.RUnlock()
    75  	return len(fake.blockDataHashingStructureWidthArgsForCall)
    76  }
    77  
    78  func (fake *ChannelConfig) BlockDataHashingStructureWidthCalls(stub func() uint32) {
    79  	fake.blockDataHashingStructureWidthMutex.Lock()
    80  	defer fake.blockDataHashingStructureWidthMutex.Unlock()
    81  	fake.BlockDataHashingStructureWidthStub = stub
    82  }
    83  
    84  func (fake *ChannelConfig) BlockDataHashingStructureWidthReturns(result1 uint32) {
    85  	fake.blockDataHashingStructureWidthMutex.Lock()
    86  	defer fake.blockDataHashingStructureWidthMutex.Unlock()
    87  	fake.BlockDataHashingStructureWidthStub = nil
    88  	fake.blockDataHashingStructureWidthReturns = struct {
    89  		result1 uint32
    90  	}{result1}
    91  }
    92  
    93  func (fake *ChannelConfig) BlockDataHashingStructureWidthReturnsOnCall(i int, result1 uint32) {
    94  	fake.blockDataHashingStructureWidthMutex.Lock()
    95  	defer fake.blockDataHashingStructureWidthMutex.Unlock()
    96  	fake.BlockDataHashingStructureWidthStub = nil
    97  	if fake.blockDataHashingStructureWidthReturnsOnCall == nil {
    98  		fake.blockDataHashingStructureWidthReturnsOnCall = make(map[int]struct {
    99  			result1 uint32
   100  		})
   101  	}
   102  	fake.blockDataHashingStructureWidthReturnsOnCall[i] = struct {
   103  		result1 uint32
   104  	}{result1}
   105  }
   106  
   107  func (fake *ChannelConfig) Capabilities() channelconfig.ChannelCapabilities {
   108  	fake.capabilitiesMutex.Lock()
   109  	ret, specificReturn := fake.capabilitiesReturnsOnCall[len(fake.capabilitiesArgsForCall)]
   110  	fake.capabilitiesArgsForCall = append(fake.capabilitiesArgsForCall, struct {
   111  	}{})
   112  	fake.recordInvocation("Capabilities", []interface{}{})
   113  	fake.capabilitiesMutex.Unlock()
   114  	if fake.CapabilitiesStub != nil {
   115  		return fake.CapabilitiesStub()
   116  	}
   117  	if specificReturn {
   118  		return ret.result1
   119  	}
   120  	fakeReturns := fake.capabilitiesReturns
   121  	return fakeReturns.result1
   122  }
   123  
   124  func (fake *ChannelConfig) CapabilitiesCallCount() int {
   125  	fake.capabilitiesMutex.RLock()
   126  	defer fake.capabilitiesMutex.RUnlock()
   127  	return len(fake.capabilitiesArgsForCall)
   128  }
   129  
   130  func (fake *ChannelConfig) CapabilitiesCalls(stub func() channelconfig.ChannelCapabilities) {
   131  	fake.capabilitiesMutex.Lock()
   132  	defer fake.capabilitiesMutex.Unlock()
   133  	fake.CapabilitiesStub = stub
   134  }
   135  
   136  func (fake *ChannelConfig) CapabilitiesReturns(result1 channelconfig.ChannelCapabilities) {
   137  	fake.capabilitiesMutex.Lock()
   138  	defer fake.capabilitiesMutex.Unlock()
   139  	fake.CapabilitiesStub = nil
   140  	fake.capabilitiesReturns = struct {
   141  		result1 channelconfig.ChannelCapabilities
   142  	}{result1}
   143  }
   144  
   145  func (fake *ChannelConfig) CapabilitiesReturnsOnCall(i int, result1 channelconfig.ChannelCapabilities) {
   146  	fake.capabilitiesMutex.Lock()
   147  	defer fake.capabilitiesMutex.Unlock()
   148  	fake.CapabilitiesStub = nil
   149  	if fake.capabilitiesReturnsOnCall == nil {
   150  		fake.capabilitiesReturnsOnCall = make(map[int]struct {
   151  			result1 channelconfig.ChannelCapabilities
   152  		})
   153  	}
   154  	fake.capabilitiesReturnsOnCall[i] = struct {
   155  		result1 channelconfig.ChannelCapabilities
   156  	}{result1}
   157  }
   158  
   159  func (fake *ChannelConfig) HashingAlgorithm() func(input []byte) []byte {
   160  	fake.hashingAlgorithmMutex.Lock()
   161  	ret, specificReturn := fake.hashingAlgorithmReturnsOnCall[len(fake.hashingAlgorithmArgsForCall)]
   162  	fake.hashingAlgorithmArgsForCall = append(fake.hashingAlgorithmArgsForCall, struct {
   163  	}{})
   164  	fake.recordInvocation("HashingAlgorithm", []interface{}{})
   165  	fake.hashingAlgorithmMutex.Unlock()
   166  	if fake.HashingAlgorithmStub != nil {
   167  		return fake.HashingAlgorithmStub()
   168  	}
   169  	if specificReturn {
   170  		return ret.result1
   171  	}
   172  	fakeReturns := fake.hashingAlgorithmReturns
   173  	return fakeReturns.result1
   174  }
   175  
   176  func (fake *ChannelConfig) HashingAlgorithmCallCount() int {
   177  	fake.hashingAlgorithmMutex.RLock()
   178  	defer fake.hashingAlgorithmMutex.RUnlock()
   179  	return len(fake.hashingAlgorithmArgsForCall)
   180  }
   181  
   182  func (fake *ChannelConfig) HashingAlgorithmCalls(stub func() func(input []byte) []byte) {
   183  	fake.hashingAlgorithmMutex.Lock()
   184  	defer fake.hashingAlgorithmMutex.Unlock()
   185  	fake.HashingAlgorithmStub = stub
   186  }
   187  
   188  func (fake *ChannelConfig) HashingAlgorithmReturns(result1 func(input []byte) []byte) {
   189  	fake.hashingAlgorithmMutex.Lock()
   190  	defer fake.hashingAlgorithmMutex.Unlock()
   191  	fake.HashingAlgorithmStub = nil
   192  	fake.hashingAlgorithmReturns = struct {
   193  		result1 func(input []byte) []byte
   194  	}{result1}
   195  }
   196  
   197  func (fake *ChannelConfig) HashingAlgorithmReturnsOnCall(i int, result1 func(input []byte) []byte) {
   198  	fake.hashingAlgorithmMutex.Lock()
   199  	defer fake.hashingAlgorithmMutex.Unlock()
   200  	fake.HashingAlgorithmStub = nil
   201  	if fake.hashingAlgorithmReturnsOnCall == nil {
   202  		fake.hashingAlgorithmReturnsOnCall = make(map[int]struct {
   203  			result1 func(input []byte) []byte
   204  		})
   205  	}
   206  	fake.hashingAlgorithmReturnsOnCall[i] = struct {
   207  		result1 func(input []byte) []byte
   208  	}{result1}
   209  }
   210  
   211  func (fake *ChannelConfig) OrdererAddresses() []string {
   212  	fake.ordererAddressesMutex.Lock()
   213  	ret, specificReturn := fake.ordererAddressesReturnsOnCall[len(fake.ordererAddressesArgsForCall)]
   214  	fake.ordererAddressesArgsForCall = append(fake.ordererAddressesArgsForCall, struct {
   215  	}{})
   216  	fake.recordInvocation("OrdererAddresses", []interface{}{})
   217  	fake.ordererAddressesMutex.Unlock()
   218  	if fake.OrdererAddressesStub != nil {
   219  		return fake.OrdererAddressesStub()
   220  	}
   221  	if specificReturn {
   222  		return ret.result1
   223  	}
   224  	fakeReturns := fake.ordererAddressesReturns
   225  	return fakeReturns.result1
   226  }
   227  
   228  func (fake *ChannelConfig) OrdererAddressesCallCount() int {
   229  	fake.ordererAddressesMutex.RLock()
   230  	defer fake.ordererAddressesMutex.RUnlock()
   231  	return len(fake.ordererAddressesArgsForCall)
   232  }
   233  
   234  func (fake *ChannelConfig) OrdererAddressesCalls(stub func() []string) {
   235  	fake.ordererAddressesMutex.Lock()
   236  	defer fake.ordererAddressesMutex.Unlock()
   237  	fake.OrdererAddressesStub = stub
   238  }
   239  
   240  func (fake *ChannelConfig) OrdererAddressesReturns(result1 []string) {
   241  	fake.ordererAddressesMutex.Lock()
   242  	defer fake.ordererAddressesMutex.Unlock()
   243  	fake.OrdererAddressesStub = nil
   244  	fake.ordererAddressesReturns = struct {
   245  		result1 []string
   246  	}{result1}
   247  }
   248  
   249  func (fake *ChannelConfig) OrdererAddressesReturnsOnCall(i int, result1 []string) {
   250  	fake.ordererAddressesMutex.Lock()
   251  	defer fake.ordererAddressesMutex.Unlock()
   252  	fake.OrdererAddressesStub = nil
   253  	if fake.ordererAddressesReturnsOnCall == nil {
   254  		fake.ordererAddressesReturnsOnCall = make(map[int]struct {
   255  			result1 []string
   256  		})
   257  	}
   258  	fake.ordererAddressesReturnsOnCall[i] = struct {
   259  		result1 []string
   260  	}{result1}
   261  }
   262  
   263  func (fake *ChannelConfig) Invocations() map[string][][]interface{} {
   264  	fake.invocationsMutex.RLock()
   265  	defer fake.invocationsMutex.RUnlock()
   266  	fake.blockDataHashingStructureWidthMutex.RLock()
   267  	defer fake.blockDataHashingStructureWidthMutex.RUnlock()
   268  	fake.capabilitiesMutex.RLock()
   269  	defer fake.capabilitiesMutex.RUnlock()
   270  	fake.hashingAlgorithmMutex.RLock()
   271  	defer fake.hashingAlgorithmMutex.RUnlock()
   272  	fake.ordererAddressesMutex.RLock()
   273  	defer fake.ordererAddressesMutex.RUnlock()
   274  	copiedInvocations := map[string][][]interface{}{}
   275  	for key, value := range fake.invocations {
   276  		copiedInvocations[key] = value
   277  	}
   278  	return copiedInvocations
   279  }
   280  
   281  func (fake *ChannelConfig) recordInvocation(key string, args []interface{}) {
   282  	fake.invocationsMutex.Lock()
   283  	defer fake.invocationsMutex.Unlock()
   284  	if fake.invocations == nil {
   285  		fake.invocations = map[string][][]interface{}{}
   286  	}
   287  	if fake.invocations[key] == nil {
   288  		fake.invocations[key] = [][]interface{}{}
   289  	}
   290  	fake.invocations[key] = append(fake.invocations[key], args)
   291  }