Skip to content

Commit df682a7

Browse files
committed
bump go to 1.24.2
Signed-off-by: Fedor Partanskiy <fredprtnsk@gmail.com>
1 parent 052408e commit df682a7

File tree

27 files changed

+296
-322
lines changed

27 files changed

+296
-322
lines changed

common/flogging/fabenc/formatter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestParseFormat(t *testing.T) {
7575
}
7676

7777
for _, tc := range tests {
78-
t.Run(fmt.Sprintf(tc.desc), func(t *testing.T) {
78+
t.Run(tc.desc, func(t *testing.T) {
7979
formatters, err := fabenc.ParseFormat(tc.spec)
8080
require.NoError(t, err)
8181
require.Equal(t, tc.formatters, formatters)

common/flogging/zap.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,19 @@ type FabricLogger struct{ s *zap.SugaredLogger }
5858
func (f *FabricLogger) DPanic(args ...interface{}) { f.s.DPanicf(formatArgs(args)) }
5959
func (f *FabricLogger) DPanicf(template string, args ...interface{}) { f.s.DPanicf(template, args...) }
6060
func (f *FabricLogger) DPanicw(msg string, kvPairs ...interface{}) { f.s.DPanicw(msg, kvPairs...) }
61-
func (f *FabricLogger) Debug(args ...interface{}) { f.s.Debugf(formatArgs(args)) }
61+
func (f *FabricLogger) Debug(args ...interface{}) { f.s.Debug(formatArgs(args)) }
6262
func (f *FabricLogger) Debugf(template string, args ...interface{}) { f.s.Debugf(template, args...) }
6363
func (f *FabricLogger) Debugw(msg string, kvPairs ...interface{}) { f.s.Debugw(msg, kvPairs...) }
64-
func (f *FabricLogger) Error(args ...interface{}) { f.s.Errorf(formatArgs(args)) }
64+
func (f *FabricLogger) Error(args ...interface{}) { f.s.Error(formatArgs(args)) }
6565
func (f *FabricLogger) Errorf(template string, args ...interface{}) { f.s.Errorf(template, args...) }
6666
func (f *FabricLogger) Errorw(msg string, kvPairs ...interface{}) { f.s.Errorw(msg, kvPairs...) }
67-
func (f *FabricLogger) Fatal(args ...interface{}) { f.s.Fatalf(formatArgs(args)) }
67+
func (f *FabricLogger) Fatal(args ...interface{}) { f.s.Fatal(formatArgs(args)) }
6868
func (f *FabricLogger) Fatalf(template string, args ...interface{}) { f.s.Fatalf(template, args...) }
6969
func (f *FabricLogger) Fatalw(msg string, kvPairs ...interface{}) { f.s.Fatalw(msg, kvPairs...) }
70-
func (f *FabricLogger) Info(args ...interface{}) { f.s.Infof(formatArgs(args)) }
70+
func (f *FabricLogger) Info(args ...interface{}) { f.s.Info(formatArgs(args)) }
7171
func (f *FabricLogger) Infof(template string, args ...interface{}) { f.s.Infof(template, args...) }
7272
func (f *FabricLogger) Infow(msg string, kvPairs ...interface{}) { f.s.Infow(msg, kvPairs...) }
73-
func (f *FabricLogger) Panic(args ...interface{}) { f.s.Panicf(formatArgs(args)) }
73+
func (f *FabricLogger) Panic(args ...interface{}) { f.s.Panic(formatArgs(args)) }
7474
func (f *FabricLogger) Panicf(template string, args ...interface{}) { f.s.Panicf(template, args...) }
7575
func (f *FabricLogger) Panicw(msg string, kvPairs ...interface{}) { f.s.Panicw(msg, kvPairs...) }
7676
func (f *FabricLogger) Warn(args ...interface{}) { f.s.Warnf(formatArgs(args)) }
@@ -80,9 +80,9 @@ func (f *FabricLogger) Warning(args ...interface{}) { f.s.Warn
8080
func (f *FabricLogger) Warningf(template string, args ...interface{}) { f.s.Warnf(template, args...) }
8181

8282
// for backwards compatibility
83-
func (f *FabricLogger) Critical(args ...interface{}) { f.s.Errorf(formatArgs(args)) }
83+
func (f *FabricLogger) Critical(args ...interface{}) { f.s.Error(formatArgs(args)) }
8484
func (f *FabricLogger) Criticalf(template string, args ...interface{}) { f.s.Errorf(template, args...) }
85-
func (f *FabricLogger) Notice(args ...interface{}) { f.s.Infof(formatArgs(args)) }
85+
func (f *FabricLogger) Notice(args ...interface{}) { f.s.Info(formatArgs(args)) }
8686
func (f *FabricLogger) Noticef(template string, args ...interface{}) { f.s.Infof(template, args...) }
8787

8888
func (f *FabricLogger) Named(name string) *FabricLogger { return &FabricLogger{s: f.s.Named(name)} }

common/policies/implicitmeta.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (imp *ImplicitMetaPolicy) EvaluateSignedData(signatureSet []*protoutil.Sign
8383
b.WriteString(" ")
8484
}
8585
b.WriteString("]")
86-
logger.Debugf(b.String())
86+
logger.Debug(b.String())
8787
}
8888
}
8989
}()
@@ -126,7 +126,7 @@ func (imp *ImplicitMetaPolicy) EvaluateIdentities(identities []msp.Identity) err
126126
b.WriteString(" ")
127127
}
128128
b.WriteString("]")
129-
logger.Debugf(b.String())
129+
logger.Debug(b.String())
130130
}()
131131

132132
for _, policy := range imp.SubPolicies {

core/chaincode/accesscontrol/access.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (ac *Authenticator) authenticate(msg *pb.ChaincodeMessage, stream grpc.Serv
8787
if registeredName != ccName {
8888
errMsg := fmt.Sprintf("Chaincode %s with given certificate hash %v belongs to a different chaincode", ccName, hash)
8989
logger.Warning(errMsg)
90-
return fmt.Errorf(errMsg)
90+
return errors.New(errMsg)
9191
}
9292

9393
logger.Debug("Chaincode", ccName, "'s authentication is authorized")

core/committer/txvalidator/v14/vscc_validator.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,7 @@ func (v *VsccValidatorImpl) GetInfoForValidate(chdr *common.ChannelHeader, ccID
345345
// obtain name of the VSCC and the policy
346346
cd, err := v.getCDataForCC(chdr.ChannelId, ccID)
347347
if err != nil {
348-
msg := fmt.Sprintf("Unable to get chaincode data from ledger for txid %s, due to %s", chdr.TxId, err)
349-
logger.Errorf(msg)
348+
logger.Errorf("Unable to get chaincode data from ledger for txid %s, due to %s", chdr.TxId, err)
350349
return nil, nil, nil, err
351350
}
352351
cc.ChaincodeName = cd.Name

core/committer/txvalidator/v20/plugindispatcher/dispatcher.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,7 @@ func (v *dispatcherImpl) GetInfoForValidate(chdr *common.ChannelHeader, ccID str
267267
// obtain name of the validation plugin and the policy
268268
plugin, args, err := v.getCDataForCC(chdr.ChannelId, ccID)
269269
if err != nil {
270-
msg := fmt.Sprintf("Unable to get chaincode data from ledger for txid %s, due to %s", chdr.TxId, err)
271-
logger.Errorf(msg)
270+
logger.Errorf("Unable to get chaincode data from ledger for txid %s, due to %s", chdr.TxId, err)
272271
return "", nil, err
273272
}
274273
return plugin, args, nil

core/common/validation/msgvalidation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ func validateSignatureHeader(sHdr *common.SignatureHeader) error {
7171
}
7272

7373
// ensure that there is a nonce
74-
if sHdr.Nonce == nil || len(sHdr.Nonce) == 0 {
74+
if len(sHdr.Nonce) == 0 {
7575
return errors.New("invalid nonce specified in the header")
7676
}
7777

7878
// ensure that there is a creator
79-
if sHdr.Creator == nil || len(sHdr.Creator) == 0 {
79+
if len(sHdr.Creator) == 0 {
8080
return errors.New("invalid creator specified in the header")
8181
}
8282

core/common/validation/statebased/validator_keylevel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (p *baseEvaluator) checkSBAndCCEP(cc, coll, key string, blockNum, txNum uin
5252
// logged and ignored. The ledger will take the most appropriate action
5353
// when performing its side of the validation.
5454
case *ledger.CollConfigNotDefinedError, *ledger.InvalidCollNameError:
55-
logger.Warningf(errors.WithMessage(err, "skipping key-level validation").Error())
55+
logger.Warning(errors.WithMessage(err, "skipping key-level validation").Error())
5656
// 3) any other type of error should return an execution failure which will
5757
// lead to halting the processing on this channel. Note that any non-categorized
5858
// deterministic error would be caught by the default and would lead to

core/common/validation/statebased/vpmanagerimpl.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ func (m *KeyLevelValidationParameterManagerImpl) GetValidationParameterForKey(cc
306306
// bail, if the validation parameter has been updated in the meantime
307307
err := vCtx.waitForValidationResults(newLedgerKeyID(cc, coll, key), blockNum, txNum)
308308
if err != nil {
309-
logger.Errorf(err.Error())
309+
logger.Error(err.Error())
310310
return nil, err
311311
}
312312

@@ -316,7 +316,7 @@ func (m *KeyLevelValidationParameterManagerImpl) GetValidationParameterForKey(cc
316316
state, err := m.StateFetcher.FetchState()
317317
if err != nil {
318318
err = errors.WithMessage(err, "could not retrieve ledger")
319-
logger.Errorf(err.Error())
319+
logger.Error(err.Error())
320320
return nil, err
321321
}
322322
defer state.Done()
@@ -326,14 +326,14 @@ func (m *KeyLevelValidationParameterManagerImpl) GetValidationParameterForKey(cc
326326
mdMap, err = state.GetStateMetadata(cc, key)
327327
if err != nil {
328328
err = errors.WithMessagef(err, "could not retrieve metadata for %s:%s", cc, key)
329-
logger.Errorf(err.Error())
329+
logger.Error(err.Error())
330330
return nil, err
331331
}
332332
} else {
333333
mdMap, err = state.GetPrivateDataMetadataByHash(cc, coll, []byte(key))
334334
if err != nil {
335335
err = errors.WithMessagef(err, "could not retrieve metadata for %s:%s:%x", cc, coll, []byte(key))
336-
logger.Errorf(err.Error())
336+
logger.Error(err.Error())
337337
return nil, err
338338
}
339339
}

core/deliverservice/deliveryclient.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ func (d *deliverServiceImpl) StartDeliverForChannel(chainID string, ledgerInfo b
108108
defer d.lock.Unlock()
109109
if d.stopping {
110110
errMsg := fmt.Sprintf("Delivery service is stopping cannot join a new channel %s", chainID)
111-
logger.Errorf(errMsg)
111+
logger.Error(errMsg)
112112
return errors.New(errMsg)
113113
}
114114
if _, exist := d.blockProviders[chainID]; exist {
115115
errMsg := fmt.Sprintf("Delivery service - block provider already exists for %s found, can't start delivery", chainID)
116-
logger.Errorf(errMsg)
116+
logger.Error(errMsg)
117117
return errors.New(errMsg)
118118
}
119119

@@ -169,13 +169,13 @@ func (d *deliverServiceImpl) StopDeliverForChannel(chainID string) error {
169169
defer d.lock.Unlock()
170170
if d.stopping {
171171
errMsg := fmt.Sprintf("Delivery service is stopping, cannot stop delivery for channel %s", chainID)
172-
logger.Errorf(errMsg)
172+
logger.Error(errMsg)
173173
return errors.New(errMsg)
174174
}
175175
client, exist := d.blockProviders[chainID]
176176
if !exist {
177177
errMsg := fmt.Sprintf("Delivery service - no block provider for %s found, can't stop delivery", chainID)
178-
logger.Errorf(errMsg)
178+
logger.Error(errMsg)
179179
return errors.New(errMsg)
180180
}
181181
client.Stop()

0 commit comments

Comments
 (0)