Skip to content

Commit 36a34da

Browse files
committed
[FAB-8834] Remove fsm from codebase
This completes the cleanup of fsm by: - removing fsm code from core package - removing fms package from vendor - removing references to FSM in log messages Change-Id: I0a1d3638ff5692522f7c2affdf065d3d37ff8330 Signed-off-by: Gari Singh <gari.r.singh@gmail.com>
1 parent b4c9f89 commit 36a34da

File tree

11 files changed

+5
-1055
lines changed

11 files changed

+5
-1055
lines changed

core/chaincode/chaincode_support.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ func (chaincodeSupport *ChaincodeSupport) Stop(context context.Context, cccid *c
618618
return err
619619
}
620620

621-
// Launch will launch the chaincode if not running (if running return nil) and will wait for handler of the chaincode to get into FSM ready state.
621+
// Launch will launch the chaincode if not running (if running return nil) and will wait for handler of the chaincode to get into ready state.
622622
func (chaincodeSupport *ChaincodeSupport) Launch(context context.Context, cccid *ccprovider.CCContext, spec interface{}) (*pb.ChaincodeID, *pb.ChaincodeInput, error) {
623623
//build the chaincode
624624
var cID *pb.ChaincodeID

core/chaincode/shim/handler.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ func (handler *Handler) handleReady(msg *pb.ChaincodeMessage, errc chan error) e
707707
return nil
708708
}
709709

710-
return errors.Errorf("[%s]Chaincode handler FSM cannot handle message (%s) with payload size (%d) while in state: %s", msg.Txid, msg.Type, len(msg.Payload), handler.state)
710+
return errors.Errorf("[%s]Chaincode handler cannot handle message (%s) with payload size (%d) while in state: %s", msg.Txid, msg.Type, len(msg.Payload), handler.state)
711711
}
712712

713713
//handle established state
@@ -716,7 +716,7 @@ func (handler *Handler) handleEstablished(msg *pb.ChaincodeMessage, errc chan er
716716
handler.state = "ready"
717717
return nil
718718
}
719-
return errors.Errorf("[%s]Chaincode handler FSM cannot handle message (%s) with payload size (%d) while in state: %s", msg.Txid, msg.Type, len(msg.Payload), handler.state)
719+
return errors.Errorf("[%s]Chaincode handler cannot handle message (%s) with payload size (%d) while in state: %s", msg.Txid, msg.Type, len(msg.Payload), handler.state)
720720
}
721721

722722
//handle created state
@@ -725,7 +725,7 @@ func (handler *Handler) handleCreated(msg *pb.ChaincodeMessage, errc chan error)
725725
handler.state = "established"
726726
return nil
727727
}
728-
return errors.Errorf("[%s]Chaincode handler FSM cannot handle message (%s) with payload size (%d) while in state: %s", msg.Txid, msg.Type, len(msg.Payload), handler.state)
728+
return errors.Errorf("[%s]Chaincode handler cannot handle message (%s) with payload size (%d) while in state: %s", msg.Txid, msg.Type, len(msg.Payload), handler.state)
729729
}
730730

731731
// handleMessage message handles loop for shim side of chaincode/peer stream.
@@ -746,7 +746,7 @@ func (handler *Handler) handleMessage(msg *pb.ChaincodeMessage, errc chan error)
746746
case "created":
747747
err = handler.handleCreated(msg, errc)
748748
default:
749-
err = errors.Errorf("[%s]Chaincode handler FSM cannot handle message (%s) with payload size (%d) while in state: %s", msg.Txid, msg.Type, len(msg.Payload), handler.state)
749+
err = errors.Errorf("[%s]Chaincode handler cannot handle message (%s) with payload size (%d) while in state: %s", msg.Txid, msg.Type, len(msg.Payload), handler.state)
750750
}
751751

752752
if err != nil {

core/fsm.go

-72
This file was deleted.

core/fsm_test.go

-93
This file was deleted.

0 commit comments

Comments
 (0)