   (clj->proto [this]
     (-> (ProposalPackage$ChaincodeHeaderExtension/newBuilder)
         (.setChaincodeId ^Chaincode$ChaincodeID (clj->proto chaincode-id))
-        (.setPayloadVisibility ByteString/EMPTY) ;; FIXME: payload-visibility
+        (.setPayloadVisibility (with-default-empty-byte-string [payload-visibility]
+                                 (throw (Exception. "Currently only supports default visibility 'all'"))))
         (.build))))
 
 (defn make-chaincode-header-extension
-  [& {:keys [payload-visibility chaincode-id] :or {payload-visibility "FIXME"}}]
+  [& {:keys [payload-visibility chaincode-id]}]
   (map->ChaincodeHeaderExtension {:payload-visibility payload-visibility
                                   :chaincode-id chaincode-id}))
 

           ))

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

        (.setChannelId channel-id)
        (.setTxId tx-id)
        (.setEpoch epoch)
        (.setExtension (with-default-empty-byte-string [extension]
                         (.toByteString ^ProposalPackage$ChaincodeHeaderExtension
                                        (clj->proto extension))))
        (.build))))

(defn make-channel-header
  [& {:keys [type version timestamp channel-id tx-id epoch extension]
      :or {type :endorser-transaction version 1 timestamp (System/currentTimeMillis) epoch 0}}]
  (map->ChannelHeader {:type type :version version :timestamp timestamp :epoch epoch
                       :channel-id channel-id :tx-id tx-id :extension extension}))

