代码拉取完成,页面将自动刷新
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package capabilities
import (
"github.com/hyperledger/fabric/msp"
cb "github.com/hyperledger/fabric/protos/common"
)
const (
channelTypeName = "Channel"
// ChannelV1_1 is the capabilties string for standard new non-backwards compatible fabric v1.1 channel capabilities.
ChannelV1_1 = "V1.1"
)
// ChannelProvider provides capabilities information for channel level config.
type ChannelProvider struct {
*registry
v11 bool
}
// NewChannelProvider creates a channel capabilities provider.
func NewChannelProvider(capabilities map[string]*cb.Capability) *ChannelProvider {
cp := &ChannelProvider{}
cp.registry = newRegistry(cp, capabilities)
_, cp.v11 = capabilities[ChannelV1_1]
return cp
}
// Type returns a descriptive string for logging purposes.
func (cp *ChannelProvider) Type() string {
return channelTypeName
}
// HasCapability returns true if the capability is supported by this binary.
func (cp *ChannelProvider) HasCapability(capability string) bool {
switch capability {
// Add new capability names here
case ChannelV1_1:
return true
default:
return false
}
}
// MSPVersion returns the level of MSP support required by this channel.
func (cp *ChannelProvider) MSPVersion() msp.MSPVersion {
switch {
case cp.v11:
return msp.MSPv1_1
default:
return msp.MSPv1_0
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。