@@ -32,15 +32,15 @@ var putilsLogger = logging.MustGetLogger("protoutils")
32
32
33
33
// validateChaincodeProposalMessage checks the validity of a Proposal message of type CHAINCODE
34
34
func validateChaincodeProposalMessage (prop * pb.Proposal , hdr * common.Header ) (* pb.ChaincodeHeaderExtension , error ) {
35
- putilsLogger .Infof ("validateChaincodeProposalMessage starts for proposal %p, header %p" , prop , hdr )
35
+ putilsLogger .Debugf ("validateChaincodeProposalMessage starts for proposal %p, header %p" , prop , hdr )
36
36
37
37
// 4) based on the header type (assuming it's CHAINCODE), look at the extensions
38
38
chaincodeHdrExt , err := utils .GetChaincodeHeaderExtension (hdr )
39
39
if err != nil {
40
40
return nil , errors .New ("Invalid header extension for type CHAINCODE" )
41
41
}
42
42
43
- putilsLogger .Infof ("validateChaincodeProposalMessage info: header extension references chaincode %s" , chaincodeHdrExt .ChaincodeId )
43
+ putilsLogger .Debugf ("validateChaincodeProposalMessage info: header extension references chaincode %s" , chaincodeHdrExt .ChaincodeId )
44
44
45
45
// - ensure that the chaincodeID is correct (?)
46
46
// TODO: should we even do this? If so, using which interface?
@@ -64,7 +64,7 @@ func validateChaincodeProposalMessage(prop *pb.Proposal, hdr *common.Header) (*p
64
64
// this function returns Header and ChaincodeHeaderExtension messages since they
65
65
// have been unmarshalled and validated
66
66
func ValidateProposalMessage (signedProp * pb.SignedProposal ) (* pb.Proposal , * common.Header , * pb.ChaincodeHeaderExtension , error ) {
67
- putilsLogger .Infof ("ValidateProposalMessage starts for signed proposal %p" , signedProp )
67
+ putilsLogger .Debugf ("ValidateProposalMessage starts for signed proposal %p" , signedProp )
68
68
69
69
// extract the Proposal message from signedProp
70
70
prop , err := utils .GetProposal (signedProp .ProposalBytes )
@@ -127,7 +127,7 @@ func ValidateProposalMessage(signedProp *pb.SignedProposal) (*pb.Proposal, *comm
127
127
// this function returns nil if the creator
128
128
// is a valid cert and the signature is valid
129
129
func checkSignatureFromCreator (creatorBytes []byte , sig []byte , msg []byte , ChainID string ) error {
130
- putilsLogger .Infof ("checkSignatureFromCreator starts" )
130
+ putilsLogger .Debugf ("checkSignatureFromCreator starts" )
131
131
132
132
// check for nil argument
133
133
if creatorBytes == nil || sig == nil || msg == nil {
@@ -145,23 +145,23 @@ func checkSignatureFromCreator(creatorBytes []byte, sig []byte, msg []byte, Chai
145
145
return fmt .Errorf ("Failed to deserialize creator identity, err %s" , err )
146
146
}
147
147
148
- putilsLogger .Infof ("checkSignatureFromCreator info: creator is %s" , creator .GetIdentifier ())
148
+ putilsLogger .Debugf ("checkSignatureFromCreator info: creator is %s" , creator .GetIdentifier ())
149
149
150
150
// ensure that creator is a valid certificate
151
151
err = creator .Validate ()
152
152
if err != nil {
153
153
return fmt .Errorf ("The creator certificate is not valid, err %s" , err )
154
154
}
155
155
156
- putilsLogger .Infof ("checkSignatureFromCreator info: creator is valid" )
156
+ putilsLogger .Debugf ("checkSignatureFromCreator info: creator is valid" )
157
157
158
158
// validate the signature
159
159
err = creator .Verify (msg , sig )
160
160
if err != nil {
161
161
return fmt .Errorf ("The creator's signature over the proposal is not valid, err %s" , err )
162
162
}
163
163
164
- putilsLogger .Infof ("checkSignatureFromCreator exists successfully" )
164
+ putilsLogger .Debugf ("checkSignatureFromCreator exists successfully" )
165
165
166
166
return nil
167
167
}
@@ -200,7 +200,7 @@ func validateChannelHeader(cHdr *common.ChannelHeader) error {
200
200
return fmt .Errorf ("invalid header type %s" , common .HeaderType (cHdr .Type ))
201
201
}
202
202
203
- putilsLogger .Infof ("validateChannelHeader info: header type %d" , common .HeaderType (cHdr .Type ))
203
+ putilsLogger .Debugf ("validateChannelHeader info: header type %d" , common .HeaderType (cHdr .Type ))
204
204
205
205
// TODO: validate chainID in cHdr.ChainID
206
206
@@ -249,7 +249,7 @@ func validateCommonHeader(hdr *common.Header) (*common.ChannelHeader, *common.Si
249
249
// validateConfigTransaction validates the payload of a
250
250
// transaction assuming its type is CONFIG
251
251
func validateConfigTransaction (data []byte , hdr * common.Header ) error {
252
- putilsLogger .Infof ("validateConfigTransaction starts for data %p, header %s" , data , hdr )
252
+ putilsLogger .Debugf ("validateConfigTransaction starts for data %p, header %s" , data , hdr )
253
253
254
254
// check for nil argument
255
255
if data == nil || hdr == nil {
@@ -264,7 +264,7 @@ func validateConfigTransaction(data []byte, hdr *common.Header) error {
264
264
// validateEndorserTransaction validates the payload of a
265
265
// transaction assuming its type is ENDORSER_TRANSACTION
266
266
func validateEndorserTransaction (data []byte , hdr * common.Header ) error {
267
- putilsLogger .Infof ("validateEndorserTransaction starts for data %p, header %s" , data , hdr )
267
+ putilsLogger .Debugf ("validateEndorserTransaction starts for data %p, header %s" , data , hdr )
268
268
269
269
// check for nil argument
270
270
if data == nil || hdr == nil {
@@ -290,7 +290,7 @@ func validateEndorserTransaction(data []byte, hdr *common.Header) error {
290
290
return errors .New ("At least one TransactionAction is required" )
291
291
}
292
292
293
- putilsLogger .Infof ("validateEndorserTransaction info: there are %d actions" , len (tx .Actions ))
293
+ putilsLogger .Debugf ("validateEndorserTransaction info: there are %d actions" , len (tx .Actions ))
294
294
295
295
for _ , act := range tx .Actions {
296
296
// check for nil argument
@@ -311,7 +311,7 @@ func validateEndorserTransaction(data []byte, hdr *common.Header) error {
311
311
return err
312
312
}
313
313
314
- putilsLogger .Infof ("validateEndorserTransaction info: signature header is valid" )
314
+ putilsLogger .Debugf ("validateEndorserTransaction info: signature header is valid" )
315
315
316
316
// if the type is ENDORSER_TRANSACTION we unmarshal a ChaincodeActionPayload
317
317
ccActionPayload , err := utils .GetChaincodeActionPayload (act .Payload )
@@ -346,7 +346,7 @@ func validateEndorserTransaction(data []byte, hdr *common.Header) error {
346
346
347
347
// ValidateTransaction checks that the transaction envelope is properly formed
348
348
func ValidateTransaction (e * common.Envelope ) (* common.Payload , pb.TxValidationCode ) {
349
- putilsLogger .Infof ("ValidateTransactionEnvelope starts for envelope %p" , e )
349
+ putilsLogger .Debugf ("ValidateTransactionEnvelope starts for envelope %p" , e )
350
350
351
351
// check for nil argument
352
352
if e == nil {
@@ -361,7 +361,7 @@ func ValidateTransaction(e *common.Envelope) (*common.Payload, pb.TxValidationCo
361
361
return nil , pb .TxValidationCode_BAD_PAYLOAD
362
362
}
363
363
364
- putilsLogger .Infof ("Header is %s" , payload .Header )
364
+ putilsLogger .Debugf ("Header is %s" , payload .Header )
365
365
366
366
// validate the header
367
367
chdr , shdr , err := validateCommonHeader (payload .Header )
@@ -396,7 +396,7 @@ func ValidateTransaction(e *common.Envelope) (*common.Payload, pb.TxValidationCo
396
396
}
397
397
398
398
err = validateEndorserTransaction (payload .Data , payload .Header )
399
- putilsLogger .Infof ("ValidateTransactionEnvelope returns err %s" , err )
399
+ putilsLogger .Debugf ("ValidateTransactionEnvelope returns err %s" , err )
400
400
401
401
if err != nil {
402
402
putilsLogger .Errorf ("validateEndorserTransaction returns err %s" , err )
0 commit comments