@@ -148,7 +148,7 @@ type Handler struct {
148
148
149
149
// handleMessage is called by ProcessStream to dispatch messages.
150
150
func (h * Handler ) handleMessage (msg * pb.ChaincodeMessage ) error {
151
- chaincodeLogger .Debugf ("[%s]Fabric side Handling ChaincodeMessage of type: %s in state %s" , shorttxid (msg .Txid ), msg .Type , h .state )
151
+ chaincodeLogger .Debugf ("[%s] Fabric side Handling ChaincodeMessage of type: %s in state %s" , shorttxid (msg .Txid ), msg .Type , h .state )
152
152
153
153
if msg .Type == pb .ChaincodeMessage_KEEPALIVE {
154
154
chaincodeLogger .Debug ("Received KEEPALIVE Response" )
@@ -170,7 +170,7 @@ func (h *Handler) handleMessageCreatedState(msg *pb.ChaincodeMessage) error {
170
170
case pb .ChaincodeMessage_REGISTER :
171
171
h .HandleRegister (msg )
172
172
default :
173
- return fmt .Errorf ("[%s]Fabric side handler cannot handle message (%s) while in created state" , msg .Txid , msg .Type )
173
+ return fmt .Errorf ("[%s] Fabric side handler cannot handle message (%s) while in created state" , msg .Txid , msg .Type )
174
174
}
175
175
return nil
176
176
}
@@ -201,7 +201,7 @@ func (h *Handler) handleMessageReadyState(msg *pb.ChaincodeMessage) error {
201
201
go h .HandleTransaction (msg , h .HandleQueryStateClose )
202
202
203
203
default :
204
- return fmt .Errorf ("[%s]Fabric side handler cannot handle message (%s) while in ready state" , msg .Txid , msg .Type )
204
+ return fmt .Errorf ("[%s] Fabric side handler cannot handle message (%s) while in ready state" , msg .Txid , msg .Type )
205
205
}
206
206
207
207
return nil
@@ -218,7 +218,7 @@ type handleFunc func(*pb.ChaincodeMessage, *TransactionContext) (*pb.ChaincodeMe
218
218
// returened by the delegate are sent to the chat stream. Any errors returned by the
219
219
// delegate are packaged as chaincode error messages.
220
220
func (h * Handler ) HandleTransaction (msg * pb.ChaincodeMessage , delegate handleFunc ) {
221
- chaincodeLogger .Debugf ("[%s]handling %s from chaincode" , shorttxid (msg .Txid ), msg .Type .String ())
221
+ chaincodeLogger .Debugf ("[%s] handling %s from chaincode" , shorttxid (msg .Txid ), msg .Type .String ())
222
222
if ! h .registerTxid (msg ) {
223
223
return
224
224
}
@@ -238,11 +238,11 @@ func (h *Handler) HandleTransaction(msg *pb.ChaincodeMessage, delegate handleFun
238
238
239
239
if err != nil {
240
240
err = errors .Wrapf (err , "%s failed: transaction ID: %s" , msg .Type , msg .Txid )
241
- chaincodeLogger .Errorf ("[%s]Failed to handle %s. error: %+v" , shorttxid (msg .Txid ), msg .Type , err )
241
+ chaincodeLogger .Errorf ("[%s] Failed to handle %s. error: %+v" , shorttxid (msg .Txid ), msg .Type , err )
242
242
resp = & pb.ChaincodeMessage {Type : pb .ChaincodeMessage_ERROR , Payload : []byte (err .Error ()), Txid : msg .Txid , ChannelId : msg .ChannelId }
243
243
}
244
244
245
- chaincodeLogger .Debugf ("[%s]Completed %s. Sending %s" , shorttxid (msg .Txid ), msg .Type , resp .Type )
245
+ chaincodeLogger .Debugf ("[%s] Completed %s. Sending %s" , shorttxid (msg .Txid ), msg .Type , resp .Type )
246
246
h .serialSendAsync (resp , false )
247
247
h .ActiveTransactions .Remove (msg .ChannelId , msg .Txid )
248
248
}
@@ -286,7 +286,7 @@ func (h *Handler) serialSend(msg *pb.ChaincodeMessage) error {
286
286
287
287
var err error
288
288
if err = h .chatStream .Send (msg ); err != nil {
289
- err = errors .WithMessage (err , fmt .Sprintf ("[%s]Error sending %s" , shorttxid (msg .Txid ), msg .Type ))
289
+ err = errors .WithMessage (err , fmt .Sprintf ("[%s] Error sending %s" , shorttxid (msg .Txid ), msg .Type ))
290
290
chaincodeLogger .Errorf ("%+v" , err )
291
291
}
292
292
return err
@@ -385,7 +385,7 @@ func (h *Handler) ProcessStream(stream ccintf.ChaincodeStream) error {
385
385
}
386
386
387
387
in := rMsg .msg
388
- chaincodeLogger .Debugf ("[%s]Received message %s from shim" , shorttxid (in .Txid ), in .Type )
388
+ chaincodeLogger .Debugf ("[%s] Received message %s from shim" , shorttxid (in .Txid ), in .Type )
389
389
390
390
err := h .handleMessage (in )
391
391
if err != nil {
@@ -486,7 +486,7 @@ func (h *Handler) Notify(msg *pb.ChaincodeMessage) {
486
486
return
487
487
}
488
488
489
- chaincodeLogger .Debugf ("[%s]notifying Txid:%s, channelID:%s" , shorttxid (msg .Txid ), msg .Txid , msg .ChannelId )
489
+ chaincodeLogger .Debugf ("[%s] notifying Txid:%s, channelID:%s" , shorttxid (msg .Txid ), msg .Txid , msg .ChannelId )
490
490
tctx .ResponseNotifier <- msg
491
491
tctx .CloseQueryIterators ()
492
492
}
@@ -514,7 +514,7 @@ func (h *Handler) registerTxid(msg *pb.ChaincodeMessage) bool {
514
514
if h .chaincodeID != nil {
515
515
chaincodeName = h .chaincodeID .Name
516
516
}
517
- chaincodeLogger .Errorf ("[%s]Another request pending for this CC: %s, Txid: %s, ChannelID: %s. Cannot process." , shorttxid (msg .Txid ), chaincodeName , msg .Txid , msg .ChannelId )
517
+ chaincodeLogger .Errorf ("[%s] Another request pending for this CC: %s, Txid: %s, ChannelID: %s. Cannot process." , shorttxid (msg .Txid ), chaincodeName , msg .Txid , msg .ChannelId )
518
518
return false
519
519
}
520
520
@@ -540,7 +540,7 @@ func (h *Handler) HandleGetState(msg *pb.ChaincodeMessage, txContext *Transactio
540
540
return nil , errors .WithStack (err )
541
541
}
542
542
if res == nil {
543
- chaincodeLogger .Debugf ("[%s]No state associated with key: %s. Sending %s with an empty payload" , shorttxid (msg .Txid ), key , pb .ChaincodeMessage_RESPONSE )
543
+ chaincodeLogger .Debugf ("[%s] No state associated with key: %s. Sending %s with an empty payload" , shorttxid (msg .Txid ), key , pb .ChaincodeMessage_RESPONSE )
544
544
}
545
545
546
546
// Send response msg back to chaincode. GetState will not trigger event
0 commit comments