@@ -177,11 +177,11 @@ func (pm *ManagerImpl) CommitConfig() {
177
177
}
178
178
179
179
// ProposeConfig is used to add new config to the config proposal
180
- func (pm * ManagerImpl ) ProposeConfig (configItem * cb.ConfigItem ) error {
181
- switch configItem . Key {
180
+ func (pm * ManagerImpl ) ProposeConfig (key string , configValue * cb.ConfigValue ) error {
181
+ switch key {
182
182
case ConsensusTypeKey :
183
183
consensusType := & ab.ConsensusType {}
184
- if err := proto .Unmarshal (configItem .Value , consensusType ); err != nil {
184
+ if err := proto .Unmarshal (configValue .Value , consensusType ); err != nil {
185
185
return fmt .Errorf ("Unmarshaling error for ConsensusType: %s" , err )
186
186
}
187
187
if pm .config .consensusType == "" {
@@ -194,7 +194,7 @@ func (pm *ManagerImpl) ProposeConfig(configItem *cb.ConfigItem) error {
194
194
pm .pendingConfig .consensusType = consensusType .Type
195
195
case BatchSizeKey :
196
196
batchSize := & ab.BatchSize {}
197
- if err := proto .Unmarshal (configItem .Value , batchSize ); err != nil {
197
+ if err := proto .Unmarshal (configValue .Value , batchSize ); err != nil {
198
198
return fmt .Errorf ("Unmarshaling error for BatchSize: %s" , err )
199
199
}
200
200
if batchSize .MaxMessageCount == 0 {
@@ -214,7 +214,7 @@ func (pm *ManagerImpl) ProposeConfig(configItem *cb.ConfigItem) error {
214
214
var timeoutValue time.Duration
215
215
var err error
216
216
batchTimeout := & ab.BatchTimeout {}
217
- if err = proto .Unmarshal (configItem .Value , batchTimeout ); err != nil {
217
+ if err = proto .Unmarshal (configValue .Value , batchTimeout ); err != nil {
218
218
return fmt .Errorf ("Unmarshaling error for BatchTimeout: %s" , err )
219
219
}
220
220
if timeoutValue , err = time .ParseDuration (batchTimeout .Timeout ); err != nil {
@@ -226,7 +226,7 @@ func (pm *ManagerImpl) ProposeConfig(configItem *cb.ConfigItem) error {
226
226
pm .pendingConfig .batchTimeout = timeoutValue
227
227
case ChainCreationPolicyNamesKey :
228
228
chainCreationPolicyNames := & ab.ChainCreationPolicyNames {}
229
- if err := proto .Unmarshal (configItem .Value , chainCreationPolicyNames ); err != nil {
229
+ if err := proto .Unmarshal (configValue .Value , chainCreationPolicyNames ); err != nil {
230
230
return fmt .Errorf ("Unmarshaling error for ChainCreator: %s" , err )
231
231
}
232
232
if chainCreationPolicyNames .Names == nil {
@@ -238,19 +238,19 @@ func (pm *ManagerImpl) ProposeConfig(configItem *cb.ConfigItem) error {
238
238
}
239
239
case IngressPolicyNamesKey :
240
240
ingressPolicyNames := & ab.IngressPolicyNames {}
241
- if err := proto .Unmarshal (configItem .Value , ingressPolicyNames ); err != nil {
241
+ if err := proto .Unmarshal (configValue .Value , ingressPolicyNames ); err != nil {
242
242
return fmt .Errorf ("Unmarshaling error for IngressPolicyNames: %s" , err )
243
243
}
244
244
pm .pendingConfig .ingressPolicyNames = ingressPolicyNames .Names
245
245
case EgressPolicyNamesKey :
246
246
egressPolicyNames := & ab.EgressPolicyNames {}
247
- if err := proto .Unmarshal (configItem .Value , egressPolicyNames ); err != nil {
247
+ if err := proto .Unmarshal (configValue .Value , egressPolicyNames ); err != nil {
248
248
return fmt .Errorf ("Unmarshaling error for EgressPolicyNames: %s" , err )
249
249
}
250
250
pm .pendingConfig .egressPolicyNames = egressPolicyNames .Names
251
251
case KafkaBrokersKey :
252
252
kafkaBrokers := & ab.KafkaBrokers {}
253
- if err := proto .Unmarshal (configItem .Value , kafkaBrokers ); err != nil {
253
+ if err := proto .Unmarshal (configValue .Value , kafkaBrokers ); err != nil {
254
254
return fmt .Errorf ("Unmarshaling error for KafkaBrokers: %s" , err )
255
255
}
256
256
if len (kafkaBrokers .Brokers ) == 0 {
0 commit comments