     (-> (Chaincode$ChaincodeDeploymentSpec/newBuilder)
         (.setChaincodeSpec ^Chaincode$ChaincodeSpec (clj->proto chaincode-spec))
         (.setEffectiveDate ^Timestamp (clj->proto (make-timestamp effective-date)))
-        (.setCodePackage (ByteString/copyFrom code-package))
+        (.setCodePackage (with-default-empty-byte-string [code-package]
+                           (ByteString/copyFrom code-package)))
         (.setExecEnv (exec-env-map exec-env))
         (.build))))
 

           ))

;;;
;;;
(defprotocol ICljToProto
  (clj->proto [this]))

    (-> (ProposalPackage$Proposal/newBuilder)
        (.setHeader (.toByteString ^Common$Header (clj->proto header)))
        (.setPayload (.toByteString ^ProposalPackage$ChaincodeProposalPayload (clj->proto payload)))
        (.setExtension (with-default-empty-byte-string [extension]
                         (.toByteString ^ProposalPackage$ChaincodeHeaderExtension
                                           (clj->proto extension))))
        (.build))))

(defn make-proposal
  [& {:keys [header payload extension]}]
  (map->Proposal {:header header :payload payload :extension extension}))

;; FIXME: input bytes
