@@ -29,13 +29,13 @@ import (
2929
3030// Chain config keys
3131const (
32- // HashingAlgorithmKey is the cb.ConfigurationItem type key name for the HashingAlgorithm message
32+ // HashingAlgorithmKey is the cb.ConfigItem type key name for the HashingAlgorithm message
3333 HashingAlgorithmKey = "HashingAlgorithm"
3434
35- // BlockDataHashingStructureKey is the cb.ConfigurationItem type key name for the BlockDataHashingStructure message
35+ // BlockDataHashingStructureKey is the cb.ConfigItem type key name for the BlockDataHashingStructure message
3636 BlockDataHashingStructureKey = "BlockDataHashingStructure"
3737
38- // OrdererAddressesKey is the cb.ConfigurationItem type key name for the OrdererAddresses message
38+ // OrdererAddressesKey is the cb.ConfigItem type key name for the OrdererAddresses message
3939 OrdererAddressesKey = "OrdererAddresses"
4040)
4141
@@ -47,10 +47,10 @@ const (
4747
4848var logger = logging .MustGetLogger ("common/chainconfig" )
4949
50- // Descriptor stores the common chain configuration
50+ // Descriptor stores the common chain config
5151// It is intended to be the primary accessor of DescriptorImpl
5252// It is intended to discourage use of the other exported DescriptorImpl methods
53- // which are used for updating the chain configuration by the configtx.Manager
53+ // which are used for updating the chain config by the configtx.Manager
5454type Descriptor interface {
5555 // HashingAlgorithm returns the default algorithm to be used when hashing
5656 // such as computing block hashes, and CreationPolicy digests
@@ -99,20 +99,20 @@ func (pm *DescriptorImpl) OrdererAddresses() []string {
9999 return pm .config .ordererAddresses
100100}
101101
102- // BeginConfig is used to start a new configuration proposal
102+ // BeginConfig is used to start a new config proposal
103103func (pm * DescriptorImpl ) BeginConfig () {
104104 if pm .pendingConfig != nil {
105105 logger .Panicf ("Programming error, cannot call begin in the middle of a proposal" )
106106 }
107107 pm .pendingConfig = & chainConfig {}
108108}
109109
110- // RollbackConfig is used to abandon a new configuration proposal
110+ // RollbackConfig is used to abandon a new config proposal
111111func (pm * DescriptorImpl ) RollbackConfig () {
112112 pm .pendingConfig = nil
113113}
114114
115- // CommitConfig is used to commit a new configuration proposal
115+ // CommitConfig is used to commit a new config proposal
116116func (pm * DescriptorImpl ) CommitConfig () {
117117 if pm .pendingConfig == nil {
118118 logger .Panicf ("Programming error, cannot call commit without an existing proposal" )
@@ -121,10 +121,10 @@ func (pm *DescriptorImpl) CommitConfig() {
121121 pm .pendingConfig = nil
122122}
123123
124- // ProposeConfig is used to add new configuration to the configuration proposal
125- func (pm * DescriptorImpl ) ProposeConfig (configItem * cb.ConfigurationItem ) error {
126- if configItem .Type != cb .ConfigurationItem_Chain {
127- return fmt .Errorf ("Expected type of ConfigurationItem_Chain , got %v" , configItem .Type )
124+ // ProposeConfig is used to add new config to the config proposal
125+ func (pm * DescriptorImpl ) ProposeConfig (configItem * cb.ConfigItem ) error {
126+ if configItem .Type != cb .ConfigItem_Chain {
127+ return fmt .Errorf ("Expected type of ConfigItem_Chain , got %v" , configItem .Type )
128128 }
129129
130130 switch configItem .Key {
@@ -157,7 +157,7 @@ func (pm *DescriptorImpl) ProposeConfig(configItem *cb.ConfigurationItem) error
157157 }
158158 pm .pendingConfig .ordererAddresses = ordererAddresses .Addresses
159159 default :
160- logger .Warningf ("Uknown Chain configuration item with key %s" , configItem .Key )
160+ logger .Warningf ("Uknown Chain config item with key %s" , configItem .Key )
161161 }
162162 return nil
163163}
0 commit comments