    {:data
     {:data
      {:fn #(Common$Envelope/parseFrom ^ByteString %)
-      :next
-      {:payload
-       {:data {:fn #(TransactionPackage$Transaction/parseFrom ^ByteString %)
-               :next {:actions
-                      {;;:header
-                       :payload {:fn #(TransactionPackage$ChaincodeActionPayload/parseFrom ^ByteString %)
-                                 :next {:chaincode-proposal-payload
-                                        {:fn #(ProposalResponsePackage$ProposalResponsePayload/parseFrom ^ByteString %)
-                                         :next {:extension {:fn #(ProposalPackage$ChaincodeAction/parseFrom ^ByteString %)
-                                                            ;; NB: name is ':events' but in case of ChaincodeEvent, it is an event
-                                                            :next {:events {:fn #(ChaincodeEventPackage$ChaincodeEvent/parseFrom ^ByteString %)
-                                                                            :next nil}}}}}
-                                        ;;:action ??
-                                        ;;{:proposal-response-payload }
-                                        }}}}}}}}}}
+      :payload
+      {:data {:fn #(Configtx$ConfigUpdateEnvelope/parseFrom ^ByteString %)
+              :config-update {:fn #(Configtx$ConfigUpdate/parseFrom ^ByteString %)}}}
+
+      ;; This is here for future reference
+      ;; 
+      ;; {;;:fn #(Common$Payload/parseFrom ^ByteString %)
+      ;;  :data {:fn #(TransactionPackage$Transaction/parseFrom ^ByteString %)
+      ;;         :actions
+      ;;         { ;;:header
+      ;;          :payload {:fn #(TransactionPackage$ChaincodeActionPayload/parseFrom ^ByteString %)
+      ;;                    :chaincode-proposal-payload
+      ;;                    {:fn #(ProposalPackage$ChaincodeProposalPayload/parseFrom ^ByteString %)
+      ;;                     :input {:fn #(Chaincode$ChaincodeInvocationSpec/parseFrom ^ByteString %)}}
+                         
+      ;;                    :action
+      ;;                    {:proposal-response-payload
+      ;;                     {;;:fn #(ProposalResponsePackage$ProposalResponsePayload/parseFrom ^ByteString %)
+      ;;                      :extension {:fn #(ProposalPackage$ChaincodeAction/parseFrom ^ByteString %)
+      ;;                                  ;; NB: name is ':events' but in case of ChaincodeEvent, it is an event
+      ;;                                  :events {:fn #(ChaincodeEventPackage$ChaincodeEvent/parseFrom ^ByteString %)
+      ;;                                           }}}}}}}}
+      }}}
 
    :envelope-for-config-update
-   {:payload {:data {:fn #(Configtx$ConfigUpdateEnvelope/parseFrom ^ByteString %)
-                     :next {:config-update {:fn #(Configtx$ConfigUpdate/parseFrom ^ByteString %)}}}}}})
+   {:payload
+    {;;:fn #(Common$Payload/parseFrom ^ByteString %)
+     :data {:fn #(Configtx$ConfigUpdateEnvelope/parseFrom ^ByteString %)
+            :config-update {:fn #(Configtx$ConfigUpdate/parseFrom ^ByteString %)}}}}})
 
 (extend-protocol IProtoToClj
 

(defmacro maybe-applying-proto->clj-transform [[tx-map data-call]]
  `(let [data# ~data-call]
     (if-let [tx-fn# (:fn ~tx-map)]
       (proto->clj (tx-fn# data#) (:next ~tx-map))
       data#)))



      id-bytes (.setIdBytes (ByteString/copyFromUtf8 id-bytes))
      true (.build))))

(defn make-serialized-identity
  [& {:keys [mspid id-bytes]}]
  (map->SerializedIdentity {:mspid mspid :id-bytes id-bytes}))
