 (defn make-chaincode-header-extention
   ([chaincode-id]
    (make-chaincode-header-extention chaincode-id ByteString/EMPTY))
-  ([^Chaincode$ChaincodeID chaincode-id payload-visibility]
-   (-> (ProposalPackage$ChaincodeHeaderExtension/newBuilder)
-       (.setChaincodeId chaincode-id)
+  ([chaincode-id payload-visibility]
+   (-> (proto/new-builder ProposalPackage$ChaincodeHeaderExtension)
+       (proto/set-chaincode-id chaincode-id)
        ;; NOTE: payload-visibility is ByteString
        ;; Currently only full visibility
-       (.setPayloadVisibility payload-visibility)
-       (.build))))
-
+       (proto/set-payload-visibility payload-visibility)
+       (proto/build))))
+
+;; FIXME: Timestamp is primitive of com.google.protobuf
+;;      No idea yet how to make it nice
 (defn make-current-grpc-timestamp
   []
   (let [now (System/currentTimeMillis)]

  default-epoch)

(defn make-chaincode-header
  [^Chaincode$ChaincodeID chaincode-id channel-id tx-id epoch]
  (make-channel-header Common$HeaderType/ENDORSER_TRANSACTION ; type
                       1                ; version
                       channel-id
                       tx-id

           org.bouncycastle.util.encoders.Hex
           [org.hyperledger.fabric.protos.common Common$ChannelHeader Common$Header Common$HeaderType Common$SignatureHeader]
           org.hyperledger.fabric.protos.msp.Identities$SerializedIdentity
           [org.hyperledger.fabric.protos.peer Chaincode$ChaincodeID Chaincode$ChaincodeInput Chaincode$ChaincodeInvocationSpec Chaincode$ChaincodeSpec Chaincode$ChaincodeSpec$Type EndorserGrpc ProposalPackage$ChaincodeHeaderExtension ProposalPackage$ChaincodeProposalPayload ProposalPackage$Proposal ProposalPackage$SignedProposal]
           ))

(defonce ^:dynamic *grpc-configuration*
  ;; From Java SDK
