@@ -29,13 +29,13 @@ import (
29
29
30
30
// Chain config keys
31
31
const (
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
33
33
HashingAlgorithmKey = "HashingAlgorithm"
34
34
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
36
36
BlockDataHashingStructureKey = "BlockDataHashingStructure"
37
37
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
39
39
OrdererAddressesKey = "OrdererAddresses"
40
40
)
41
41
@@ -47,10 +47,10 @@ const (
47
47
48
48
var logger = logging .MustGetLogger ("common/chainconfig" )
49
49
50
- // Descriptor stores the common chain configuration
50
+ // Descriptor stores the common chain config
51
51
// It is intended to be the primary accessor of DescriptorImpl
52
52
// 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
54
54
type Descriptor interface {
55
55
// HashingAlgorithm returns the default algorithm to be used when hashing
56
56
// such as computing block hashes, and CreationPolicy digests
@@ -99,20 +99,20 @@ func (pm *DescriptorImpl) OrdererAddresses() []string {
99
99
return pm .config .ordererAddresses
100
100
}
101
101
102
- // BeginConfig is used to start a new configuration proposal
102
+ // BeginConfig is used to start a new config proposal
103
103
func (pm * DescriptorImpl ) BeginConfig () {
104
104
if pm .pendingConfig != nil {
105
105
logger .Panicf ("Programming error, cannot call begin in the middle of a proposal" )
106
106
}
107
107
pm .pendingConfig = & chainConfig {}
108
108
}
109
109
110
- // RollbackConfig is used to abandon a new configuration proposal
110
+ // RollbackConfig is used to abandon a new config proposal
111
111
func (pm * DescriptorImpl ) RollbackConfig () {
112
112
pm .pendingConfig = nil
113
113
}
114
114
115
- // CommitConfig is used to commit a new configuration proposal
115
+ // CommitConfig is used to commit a new config proposal
116
116
func (pm * DescriptorImpl ) CommitConfig () {
117
117
if pm .pendingConfig == nil {
118
118
logger .Panicf ("Programming error, cannot call commit without an existing proposal" )
@@ -121,10 +121,10 @@ func (pm *DescriptorImpl) CommitConfig() {
121
121
pm .pendingConfig = nil
122
122
}
123
123
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 )
128
128
}
129
129
130
130
switch configItem .Key {
@@ -157,7 +157,7 @@ func (pm *DescriptorImpl) ProposeConfig(configItem *cb.ConfigurationItem) error
157
157
}
158
158
pm .pendingConfig .ordererAddresses = ordererAddresses .Addresses
159
159
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 )
161
161
}
162
162
return nil
163
163
}
0 commit comments