 (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))
+       (proto->clj (tx-fn# data#) (dissoc ~tx-map :fn))
        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}))

(defrecord ChaincodeEvent [^String chaincode-id ^String tx-id ^String event-name ^bytes payload])
(defn make-chaincode-event
  [& {:keys [chaincode-id tx-id event-name payload]}]
  (map->ChaincodeEvent {:chaincode-id chaincode-id :tx-id tx-id :event-name event-name
                        :payload payload}))

(defrecord ProposalResponsePayload [^bytes proposal-hash ^bytes extension])
(defn make-proposal-response-payload
