1 Star 0 Fork 0

妥協/fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
orderer.go 3.09 KB
一键复制 编辑 原始数据 按行查看 历史
/*
Copyright IBM Corp. 2016 All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package config
import (
"time"
"github.com/hyperledger/fabric/common/channelconfig"
ab "github.com/hyperledger/fabric/protos/orderer"
)
// Orderer is a mock implementation of channelconfig.Orderer
type Orderer struct {
// ConsensusTypeVal is returned as the result of ConsensusType()
ConsensusTypeVal string
// ConsensusMetadataVal is returned as the result of ConsensusMetadata()
ConsensusMetadataVal []byte
// BatchSizeVal is returned as the result of BatchSize()
BatchSizeVal *ab.BatchSize
// BatchTimeoutVal is returned as the result of BatchTimeout()
BatchTimeoutVal time.Duration
// KafkaBrokersVal is returned as the result of KafkaBrokers()
KafkaBrokersVal []string
// MaxChannelsCountVal is returns as the result of MaxChannelsCount()
MaxChannelsCountVal uint64
// OrganizationsVal is returned as the result of Organizations()
OrganizationsVal map[string]channelconfig.Org
// CapabilitiesVal is returned as the result of Capabilities()
CapabilitiesVal channelconfig.OrdererCapabilities
}
// ConsensusType returns the ConsensusTypeVal
func (o *Orderer) ConsensusType() string {
return o.ConsensusTypeVal
}
// ConsensusMetadata returns the ConsensusMetadataVal
func (o *Orderer) ConsensusMetadata() []byte {
return o.ConsensusMetadataVal
}
// BatchSize returns the BatchSizeVal
func (o *Orderer) BatchSize() *ab.BatchSize {
return o.BatchSizeVal
}
// BatchTimeout returns the BatchTimeoutVal
func (o *Orderer) BatchTimeout() time.Duration {
return o.BatchTimeoutVal
}
// KafkaBrokers returns the KafkaBrokersVal
func (o *Orderer) KafkaBrokers() []string {
return o.KafkaBrokersVal
}
// MaxChannelsCount returns the MaxChannelsCountVal
func (o *Orderer) MaxChannelsCount() uint64 {
return o.MaxChannelsCountVal
}
// Organizations returns OrganizationsVal
func (o *Orderer) Organizations() map[string]channelconfig.Org {
return o.OrganizationsVal
}
// Capabilities returns CapabilitiesVal
func (o *Orderer) Capabilities() channelconfig.OrdererCapabilities {
return o.CapabilitiesVal
}
// OrdererCapabilities mocks the channelconfig.OrdererCapabilities interface
type OrdererCapabilities struct {
// SupportedErr is returned by Supported()
SupportedErr error
// PredictableChannelTemplateVal is returned by PredictableChannelTemplate()
PredictableChannelTemplateVal bool
// ResubmissionVal is returned by Resubmission()
ResubmissionVal bool
// ExpirationVal is returned by ExpirationCheck()
ExpirationVal bool
}
// Supported returns SupportedErr
func (oc *OrdererCapabilities) Supported() error {
return oc.SupportedErr
}
// PredictableChannelTemplate returns PredictableChannelTemplateVal
func (oc *OrdererCapabilities) PredictableChannelTemplate() bool {
return oc.PredictableChannelTemplateVal
}
// Resubmission returns ResubmissionVal
func (oc *OrdererCapabilities) Resubmission() bool {
return oc.ResubmissionVal
}
// ExpirationCheck specifies whether the orderer checks for identity expiration checks
// when validating messages
func (oc *OrdererCapabilities) ExpirationCheck() bool {
return oc.ExpirationVal
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liurenhao/fabric.git
git@gitee.com:liurenhao/fabric.git
liurenhao
fabric
fabric
v1.3.0

搜索帮助

0d507c66 1850385 C8b1a773 1850385