1 Star 0 Fork 0

陈文甲/fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
configtx.go 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package configtx
import (
cb "github.com/hyperledger/fabric/protos/common"
)
// Validator is a mock implementation of configtx.Validator
type Validator struct {
// ChainIDVal is returned as the result of ChainID()
ChainIDVal string
// SequenceVal is returned as the result of Sequence()
SequenceVal uint64
// ApplyVal is returned by Apply
ApplyVal error
// AppliedConfigUpdateEnvelope is set by Apply
AppliedConfigUpdateEnvelope *cb.ConfigEnvelope
// ValidateVal is returned by Validate
ValidateVal error
// ProposeConfigUpdateError is returned as the error value for ProposeConfigUpdate
ProposeConfigUpdateError error
// ProposeConfigUpdateVal is returns as the value for ProposeConfigUpdate
ProposeConfigUpdateVal *cb.ConfigEnvelope
// ConfigProtoVal is returned as the value for ConfigProtoVal()
ConfigProtoVal *cb.Config
}
// ConfigProto returns the ConfigProtoVal
func (cm *Validator) ConfigProto() *cb.Config {
return cm.ConfigProtoVal
}
// ConsensusType returns the ConsensusTypeVal
func (cm *Validator) ChainID() string {
return cm.ChainIDVal
}
// BatchSize returns the BatchSizeVal
func (cm *Validator) Sequence() uint64 {
return cm.SequenceVal
}
// ProposeConfigUpdate
func (cm *Validator) ProposeConfigUpdate(update *cb.Envelope) (*cb.ConfigEnvelope, error) {
return cm.ProposeConfigUpdateVal, cm.ProposeConfigUpdateError
}
// Apply returns ApplyVal
func (cm *Validator) Apply(configEnv *cb.ConfigEnvelope) error {
cm.AppliedConfigUpdateEnvelope = configEnv
return cm.ApplyVal
}
// Validate returns ValidateVal
func (cm *Validator) Validate(configEnv *cb.ConfigEnvelope) error {
return cm.ValidateVal
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/venjia/fabric.git
git@gitee.com:venjia/fabric.git
venjia
fabric
fabric
v1.1.0-alpha

搜索帮助