6 Star 47 Fork 28

Hyperledger/fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
orderer_config.go 18.05 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
"sync"
"time"
"github.com/hyperledger/fabric-protos-go/orderer"
"github.com/hyperledger/fabric/common/channelconfig"
)
type OrdererConfig struct {
BatchSizeStub func() *orderer.BatchSize
batchSizeMutex sync.RWMutex
batchSizeArgsForCall []struct {
}
batchSizeReturns struct {
result1 *orderer.BatchSize
}
batchSizeReturnsOnCall map[int]struct {
result1 *orderer.BatchSize
}
BatchTimeoutStub func() time.Duration
batchTimeoutMutex sync.RWMutex
batchTimeoutArgsForCall []struct {
}
batchTimeoutReturns struct {
result1 time.Duration
}
batchTimeoutReturnsOnCall map[int]struct {
result1 time.Duration
}
CapabilitiesStub func() channelconfig.OrdererCapabilities
capabilitiesMutex sync.RWMutex
capabilitiesArgsForCall []struct {
}
capabilitiesReturns struct {
result1 channelconfig.OrdererCapabilities
}
capabilitiesReturnsOnCall map[int]struct {
result1 channelconfig.OrdererCapabilities
}
ConsensusMetadataStub func() []byte
consensusMetadataMutex sync.RWMutex
consensusMetadataArgsForCall []struct {
}
consensusMetadataReturns struct {
result1 []byte
}
consensusMetadataReturnsOnCall map[int]struct {
result1 []byte
}
ConsensusStateStub func() orderer.ConsensusType_State
consensusStateMutex sync.RWMutex
consensusStateArgsForCall []struct {
}
consensusStateReturns struct {
result1 orderer.ConsensusType_State
}
consensusStateReturnsOnCall map[int]struct {
result1 orderer.ConsensusType_State
}
ConsensusTypeStub func() string
consensusTypeMutex sync.RWMutex
consensusTypeArgsForCall []struct {
}
consensusTypeReturns struct {
result1 string
}
consensusTypeReturnsOnCall map[int]struct {
result1 string
}
KafkaBrokersStub func() []string
kafkaBrokersMutex sync.RWMutex
kafkaBrokersArgsForCall []struct {
}
kafkaBrokersReturns struct {
result1 []string
}
kafkaBrokersReturnsOnCall map[int]struct {
result1 []string
}
MaxChannelsCountStub func() uint64
maxChannelsCountMutex sync.RWMutex
maxChannelsCountArgsForCall []struct {
}
maxChannelsCountReturns struct {
result1 uint64
}
maxChannelsCountReturnsOnCall map[int]struct {
result1 uint64
}
OrganizationsStub func() map[string]channelconfig.OrdererOrg
organizationsMutex sync.RWMutex
organizationsArgsForCall []struct {
}
organizationsReturns struct {
result1 map[string]channelconfig.OrdererOrg
}
organizationsReturnsOnCall map[int]struct {
result1 map[string]channelconfig.OrdererOrg
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *OrdererConfig) BatchSize() *orderer.BatchSize {
fake.batchSizeMutex.Lock()
ret, specificReturn := fake.batchSizeReturnsOnCall[len(fake.batchSizeArgsForCall)]
fake.batchSizeArgsForCall = append(fake.batchSizeArgsForCall, struct {
}{})
fake.recordInvocation("BatchSize", []interface{}{})
fake.batchSizeMutex.Unlock()
if fake.BatchSizeStub != nil {
return fake.BatchSizeStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.batchSizeReturns
return fakeReturns.result1
}
func (fake *OrdererConfig) BatchSizeCallCount() int {
fake.batchSizeMutex.RLock()
defer fake.batchSizeMutex.RUnlock()
return len(fake.batchSizeArgsForCall)
}
func (fake *OrdererConfig) BatchSizeCalls(stub func() *orderer.BatchSize) {
fake.batchSizeMutex.Lock()
defer fake.batchSizeMutex.Unlock()
fake.BatchSizeStub = stub
}
func (fake *OrdererConfig) BatchSizeReturns(result1 *orderer.BatchSize) {
fake.batchSizeMutex.Lock()
defer fake.batchSizeMutex.Unlock()
fake.BatchSizeStub = nil
fake.batchSizeReturns = struct {
result1 *orderer.BatchSize
}{result1}
}
func (fake *OrdererConfig) BatchSizeReturnsOnCall(i int, result1 *orderer.BatchSize) {
fake.batchSizeMutex.Lock()
defer fake.batchSizeMutex.Unlock()
fake.BatchSizeStub = nil
if fake.batchSizeReturnsOnCall == nil {
fake.batchSizeReturnsOnCall = make(map[int]struct {
result1 *orderer.BatchSize
})
}
fake.batchSizeReturnsOnCall[i] = struct {
result1 *orderer.BatchSize
}{result1}
}
func (fake *OrdererConfig) BatchTimeout() time.Duration {
fake.batchTimeoutMutex.Lock()
ret, specificReturn := fake.batchTimeoutReturnsOnCall[len(fake.batchTimeoutArgsForCall)]
fake.batchTimeoutArgsForCall = append(fake.batchTimeoutArgsForCall, struct {
}{})
fake.recordInvocation("BatchTimeout", []interface{}{})
fake.batchTimeoutMutex.Unlock()
if fake.BatchTimeoutStub != nil {
return fake.BatchTimeoutStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.batchTimeoutReturns
return fakeReturns.result1
}
func (fake *OrdererConfig) BatchTimeoutCallCount() int {
fake.batchTimeoutMutex.RLock()
defer fake.batchTimeoutMutex.RUnlock()
return len(fake.batchTimeoutArgsForCall)
}
func (fake *OrdererConfig) BatchTimeoutCalls(stub func() time.Duration) {
fake.batchTimeoutMutex.Lock()
defer fake.batchTimeoutMutex.Unlock()
fake.BatchTimeoutStub = stub
}
func (fake *OrdererConfig) BatchTimeoutReturns(result1 time.Duration) {
fake.batchTimeoutMutex.Lock()
defer fake.batchTimeoutMutex.Unlock()
fake.BatchTimeoutStub = nil
fake.batchTimeoutReturns = struct {
result1 time.Duration
}{result1}
}
func (fake *OrdererConfig) BatchTimeoutReturnsOnCall(i int, result1 time.Duration) {
fake.batchTimeoutMutex.Lock()
defer fake.batchTimeoutMutex.Unlock()
fake.BatchTimeoutStub = nil
if fake.batchTimeoutReturnsOnCall == nil {
fake.batchTimeoutReturnsOnCall = make(map[int]struct {
result1 time.Duration
})
}
fake.batchTimeoutReturnsOnCall[i] = struct {
result1 time.Duration
}{result1}
}
func (fake *OrdererConfig) Capabilities() channelconfig.OrdererCapabilities {
fake.capabilitiesMutex.Lock()
ret, specificReturn := fake.capabilitiesReturnsOnCall[len(fake.capabilitiesArgsForCall)]
fake.capabilitiesArgsForCall = append(fake.capabilitiesArgsForCall, struct {
}{})
fake.recordInvocation("Capabilities", []interface{}{})
fake.capabilitiesMutex.Unlock()
if fake.CapabilitiesStub != nil {
return fake.CapabilitiesStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.capabilitiesReturns
return fakeReturns.result1
}
func (fake *OrdererConfig) CapabilitiesCallCount() int {
fake.capabilitiesMutex.RLock()
defer fake.capabilitiesMutex.RUnlock()
return len(fake.capabilitiesArgsForCall)
}
func (fake *OrdererConfig) CapabilitiesCalls(stub func() channelconfig.OrdererCapabilities) {
fake.capabilitiesMutex.Lock()
defer fake.capabilitiesMutex.Unlock()
fake.CapabilitiesStub = stub
}
func (fake *OrdererConfig) CapabilitiesReturns(result1 channelconfig.OrdererCapabilities) {
fake.capabilitiesMutex.Lock()
defer fake.capabilitiesMutex.Unlock()
fake.CapabilitiesStub = nil
fake.capabilitiesReturns = struct {
result1 channelconfig.OrdererCapabilities
}{result1}
}
func (fake *OrdererConfig) CapabilitiesReturnsOnCall(i int, result1 channelconfig.OrdererCapabilities) {
fake.capabilitiesMutex.Lock()
defer fake.capabilitiesMutex.Unlock()
fake.CapabilitiesStub = nil
if fake.capabilitiesReturnsOnCall == nil {
fake.capabilitiesReturnsOnCall = make(map[int]struct {
result1 channelconfig.OrdererCapabilities
})
}
fake.capabilitiesReturnsOnCall[i] = struct {
result1 channelconfig.OrdererCapabilities
}{result1}
}
func (fake *OrdererConfig) ConsensusMetadata() []byte {
fake.consensusMetadataMutex.Lock()
ret, specificReturn := fake.consensusMetadataReturnsOnCall[len(fake.consensusMetadataArgsForCall)]
fake.consensusMetadataArgsForCall = append(fake.consensusMetadataArgsForCall, struct {
}{})
fake.recordInvocation("ConsensusMetadata", []interface{}{})
fake.consensusMetadataMutex.Unlock()
if fake.ConsensusMetadataStub != nil {
return fake.ConsensusMetadataStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.consensusMetadataReturns
return fakeReturns.result1
}
func (fake *OrdererConfig) ConsensusMetadataCallCount() int {
fake.consensusMetadataMutex.RLock()
defer fake.consensusMetadataMutex.RUnlock()
return len(fake.consensusMetadataArgsForCall)
}
func (fake *OrdererConfig) ConsensusMetadataCalls(stub func() []byte) {
fake.consensusMetadataMutex.Lock()
defer fake.consensusMetadataMutex.Unlock()
fake.ConsensusMetadataStub = stub
}
func (fake *OrdererConfig) ConsensusMetadataReturns(result1 []byte) {
fake.consensusMetadataMutex.Lock()
defer fake.consensusMetadataMutex.Unlock()
fake.ConsensusMetadataStub = nil
fake.consensusMetadataReturns = struct {
result1 []byte
}{result1}
}
func (fake *OrdererConfig) ConsensusMetadataReturnsOnCall(i int, result1 []byte) {
fake.consensusMetadataMutex.Lock()
defer fake.consensusMetadataMutex.Unlock()
fake.ConsensusMetadataStub = nil
if fake.consensusMetadataReturnsOnCall == nil {
fake.consensusMetadataReturnsOnCall = make(map[int]struct {
result1 []byte
})
}
fake.consensusMetadataReturnsOnCall[i] = struct {
result1 []byte
}{result1}
}
func (fake *OrdererConfig) ConsensusState() orderer.ConsensusType_State {
fake.consensusStateMutex.Lock()
ret, specificReturn := fake.consensusStateReturnsOnCall[len(fake.consensusStateArgsForCall)]
fake.consensusStateArgsForCall = append(fake.consensusStateArgsForCall, struct {
}{})
fake.recordInvocation("ConsensusState", []interface{}{})
fake.consensusStateMutex.Unlock()
if fake.ConsensusStateStub != nil {
return fake.ConsensusStateStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.consensusStateReturns
return fakeReturns.result1
}
func (fake *OrdererConfig) ConsensusStateCallCount() int {
fake.consensusStateMutex.RLock()
defer fake.consensusStateMutex.RUnlock()
return len(fake.consensusStateArgsForCall)
}
func (fake *OrdererConfig) ConsensusStateCalls(stub func() orderer.ConsensusType_State) {
fake.consensusStateMutex.Lock()
defer fake.consensusStateMutex.Unlock()
fake.ConsensusStateStub = stub
}
func (fake *OrdererConfig) ConsensusStateReturns(result1 orderer.ConsensusType_State) {
fake.consensusStateMutex.Lock()
defer fake.consensusStateMutex.Unlock()
fake.ConsensusStateStub = nil
fake.consensusStateReturns = struct {
result1 orderer.ConsensusType_State
}{result1}
}
func (fake *OrdererConfig) ConsensusStateReturnsOnCall(i int, result1 orderer.ConsensusType_State) {
fake.consensusStateMutex.Lock()
defer fake.consensusStateMutex.Unlock()
fake.ConsensusStateStub = nil
if fake.consensusStateReturnsOnCall == nil {
fake.consensusStateReturnsOnCall = make(map[int]struct {
result1 orderer.ConsensusType_State
})
}
fake.consensusStateReturnsOnCall[i] = struct {
result1 orderer.ConsensusType_State
}{result1}
}
func (fake *OrdererConfig) ConsensusType() string {
fake.consensusTypeMutex.Lock()
ret, specificReturn := fake.consensusTypeReturnsOnCall[len(fake.consensusTypeArgsForCall)]
fake.consensusTypeArgsForCall = append(fake.consensusTypeArgsForCall, struct {
}{})
fake.recordInvocation("ConsensusType", []interface{}{})
fake.consensusTypeMutex.Unlock()
if fake.ConsensusTypeStub != nil {
return fake.ConsensusTypeStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.consensusTypeReturns
return fakeReturns.result1
}
func (fake *OrdererConfig) ConsensusTypeCallCount() int {
fake.consensusTypeMutex.RLock()
defer fake.consensusTypeMutex.RUnlock()
return len(fake.consensusTypeArgsForCall)
}
func (fake *OrdererConfig) ConsensusTypeCalls(stub func() string) {
fake.consensusTypeMutex.Lock()
defer fake.consensusTypeMutex.Unlock()
fake.ConsensusTypeStub = stub
}
func (fake *OrdererConfig) ConsensusTypeReturns(result1 string) {
fake.consensusTypeMutex.Lock()
defer fake.consensusTypeMutex.Unlock()
fake.ConsensusTypeStub = nil
fake.consensusTypeReturns = struct {
result1 string
}{result1}
}
func (fake *OrdererConfig) ConsensusTypeReturnsOnCall(i int, result1 string) {
fake.consensusTypeMutex.Lock()
defer fake.consensusTypeMutex.Unlock()
fake.ConsensusTypeStub = nil
if fake.consensusTypeReturnsOnCall == nil {
fake.consensusTypeReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.consensusTypeReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *OrdererConfig) KafkaBrokers() []string {
fake.kafkaBrokersMutex.Lock()
ret, specificReturn := fake.kafkaBrokersReturnsOnCall[len(fake.kafkaBrokersArgsForCall)]
fake.kafkaBrokersArgsForCall = append(fake.kafkaBrokersArgsForCall, struct {
}{})
fake.recordInvocation("KafkaBrokers", []interface{}{})
fake.kafkaBrokersMutex.Unlock()
if fake.KafkaBrokersStub != nil {
return fake.KafkaBrokersStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.kafkaBrokersReturns
return fakeReturns.result1
}
func (fake *OrdererConfig) KafkaBrokersCallCount() int {
fake.kafkaBrokersMutex.RLock()
defer fake.kafkaBrokersMutex.RUnlock()
return len(fake.kafkaBrokersArgsForCall)
}
func (fake *OrdererConfig) KafkaBrokersCalls(stub func() []string) {
fake.kafkaBrokersMutex.Lock()
defer fake.kafkaBrokersMutex.Unlock()
fake.KafkaBrokersStub = stub
}
func (fake *OrdererConfig) KafkaBrokersReturns(result1 []string) {
fake.kafkaBrokersMutex.Lock()
defer fake.kafkaBrokersMutex.Unlock()
fake.KafkaBrokersStub = nil
fake.kafkaBrokersReturns = struct {
result1 []string
}{result1}
}
func (fake *OrdererConfig) KafkaBrokersReturnsOnCall(i int, result1 []string) {
fake.kafkaBrokersMutex.Lock()
defer fake.kafkaBrokersMutex.Unlock()
fake.KafkaBrokersStub = nil
if fake.kafkaBrokersReturnsOnCall == nil {
fake.kafkaBrokersReturnsOnCall = make(map[int]struct {
result1 []string
})
}
fake.kafkaBrokersReturnsOnCall[i] = struct {
result1 []string
}{result1}
}
func (fake *OrdererConfig) MaxChannelsCount() uint64 {
fake.maxChannelsCountMutex.Lock()
ret, specificReturn := fake.maxChannelsCountReturnsOnCall[len(fake.maxChannelsCountArgsForCall)]
fake.maxChannelsCountArgsForCall = append(fake.maxChannelsCountArgsForCall, struct {
}{})
fake.recordInvocation("MaxChannelsCount", []interface{}{})
fake.maxChannelsCountMutex.Unlock()
if fake.MaxChannelsCountStub != nil {
return fake.MaxChannelsCountStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.maxChannelsCountReturns
return fakeReturns.result1
}
func (fake *OrdererConfig) MaxChannelsCountCallCount() int {
fake.maxChannelsCountMutex.RLock()
defer fake.maxChannelsCountMutex.RUnlock()
return len(fake.maxChannelsCountArgsForCall)
}
func (fake *OrdererConfig) MaxChannelsCountCalls(stub func() uint64) {
fake.maxChannelsCountMutex.Lock()
defer fake.maxChannelsCountMutex.Unlock()
fake.MaxChannelsCountStub = stub
}
func (fake *OrdererConfig) MaxChannelsCountReturns(result1 uint64) {
fake.maxChannelsCountMutex.Lock()
defer fake.maxChannelsCountMutex.Unlock()
fake.MaxChannelsCountStub = nil
fake.maxChannelsCountReturns = struct {
result1 uint64
}{result1}
}
func (fake *OrdererConfig) MaxChannelsCountReturnsOnCall(i int, result1 uint64) {
fake.maxChannelsCountMutex.Lock()
defer fake.maxChannelsCountMutex.Unlock()
fake.MaxChannelsCountStub = nil
if fake.maxChannelsCountReturnsOnCall == nil {
fake.maxChannelsCountReturnsOnCall = make(map[int]struct {
result1 uint64
})
}
fake.maxChannelsCountReturnsOnCall[i] = struct {
result1 uint64
}{result1}
}
func (fake *OrdererConfig) Organizations() map[string]channelconfig.OrdererOrg {
fake.organizationsMutex.Lock()
ret, specificReturn := fake.organizationsReturnsOnCall[len(fake.organizationsArgsForCall)]
fake.organizationsArgsForCall = append(fake.organizationsArgsForCall, struct {
}{})
fake.recordInvocation("Organizations", []interface{}{})
fake.organizationsMutex.Unlock()
if fake.OrganizationsStub != nil {
return fake.OrganizationsStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.organizationsReturns
return fakeReturns.result1
}
func (fake *OrdererConfig) OrganizationsCallCount() int {
fake.organizationsMutex.RLock()
defer fake.organizationsMutex.RUnlock()
return len(fake.organizationsArgsForCall)
}
func (fake *OrdererConfig) OrganizationsCalls(stub func() map[string]channelconfig.OrdererOrg) {
fake.organizationsMutex.Lock()
defer fake.organizationsMutex.Unlock()
fake.OrganizationsStub = stub
}
func (fake *OrdererConfig) OrganizationsReturns(result1 map[string]channelconfig.OrdererOrg) {
fake.organizationsMutex.Lock()
defer fake.organizationsMutex.Unlock()
fake.OrganizationsStub = nil
fake.organizationsReturns = struct {
result1 map[string]channelconfig.OrdererOrg
}{result1}
}
func (fake *OrdererConfig) OrganizationsReturnsOnCall(i int, result1 map[string]channelconfig.OrdererOrg) {
fake.organizationsMutex.Lock()
defer fake.organizationsMutex.Unlock()
fake.OrganizationsStub = nil
if fake.organizationsReturnsOnCall == nil {
fake.organizationsReturnsOnCall = make(map[int]struct {
result1 map[string]channelconfig.OrdererOrg
})
}
fake.organizationsReturnsOnCall[i] = struct {
result1 map[string]channelconfig.OrdererOrg
}{result1}
}
func (fake *OrdererConfig) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.batchSizeMutex.RLock()
defer fake.batchSizeMutex.RUnlock()
fake.batchTimeoutMutex.RLock()
defer fake.batchTimeoutMutex.RUnlock()
fake.capabilitiesMutex.RLock()
defer fake.capabilitiesMutex.RUnlock()
fake.consensusMetadataMutex.RLock()
defer fake.consensusMetadataMutex.RUnlock()
fake.consensusStateMutex.RLock()
defer fake.consensusStateMutex.RUnlock()
fake.consensusTypeMutex.RLock()
defer fake.consensusTypeMutex.RUnlock()
fake.kafkaBrokersMutex.RLock()
defer fake.kafkaBrokersMutex.RUnlock()
fake.maxChannelsCountMutex.RLock()
defer fake.maxChannelsCountMutex.RUnlock()
fake.organizationsMutex.RLock()
defer fake.organizationsMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *OrdererConfig) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hyperledger/fabric.git
git@gitee.com:hyperledger/fabric.git
hyperledger
fabric
fabric
v2.0.1

搜索帮助

0d507c66 1850385 C8b1a773 1850385