Uploaded image for project: 'Fabric'
  1. Fabric
  2. FAB-16295

investigate why Handler#deregister and Handler#registerTxID need to deal with empty chaincodeID and handle error

    Details

    • Steps to Reproduce:
      (Please add steps to reproduce)

      Description

      The code in question:

      func (h *Handler) deregister() {
      	if h.chaincodeID != "" {
      		h.Registry.Deregister(h.chaincodeID)
      	}
      }
      

      afaict, that should never happen in production and, if it does, we need to understand why. Also, there should be an error check there because if we didn't find a handler in the registry, we get back an error.

      So, task is to remove the check and simply drive deregister, run all tests, and see what breaks. If nothing seems to break, remove the check since it seems to be redundant. Regardless, add error handling and address fallout as necessary.

      Also, the following code lives in registerTxID. Again, the check really shouldn't be needed:

      	chaincodeID := "unknown"
      	if h.chaincodeID != "" {
      		chaincodeID = h.chaincodeID
      	}
      

      Note: This may be related to "dev mode." If so, let's discuss options.

        Attachments

          Activity

            People

            • Assignee:
              dereckluo Chongxin Luo
              Reporter:
              sykesm Matthew Sykes
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code