   (hash (str (.toString ^BCECPrivateKey priv-key) cert)))
 
 (defn evict-client-from-cache [client]
-  (let [enrollment (.getEnrollment ^User (client/get-user-context client))
+  (let [enrollment (.getEnrollment ^User (hf-client/get-user-context client))
         cache-key (priv-key+cert->hash (.getKey ^Enrollment enrollment)
                                       (.getCert ^Enrollment enrollment))]
     (swap! client-lru-cache cache/evict cache-key)))

  (hash (str name " " version " " path)))

(defn make-chaincode [{:keys [name version path]}]
  (-> (chaincode/new-builder)
      (chaincode/set-name name)
      (chaincode/set-version version)
      (chaincode/set-path path)
      (chaincode/build)))

(defn get-or-make-chaincode [chaincode]
  (general-lru-cache-read (chaincode->hash chaincode)

  "Clojure wrapper for Hyperledger Java SDK functions"
  (:require [clojure.algo.generic.functor :as algo]
            [clojure.string :as str]
            [clojure.core.cache :as cache]
            [buddy.core.certificates :as certs]
            [buddy.core.keys :as keys]
            [promissum.core :as promis]

            [clojure-fabric.hf-client :as hf-client]
            [clojure-fabric.crypto-suite :as crypto-suite]
            [clojure-fabric.channel :as channel]
            [clojure-fabric.chaincode-id :as chaincode-id]
            [clojure-fabric.transaction-request :as transaction-request]
            [clojure-fabric.query-by-chaincode-request :as query-by-chaincode-request]
            ;; [clojure-fabric.base-exception :as base-exception]
            ;; [clojure-fabric.instantiate-proposal-request :as instantiate-proposal-request]
            ;; [clojure-fabric.blockchain-info :as blockchain-info]
            ;; [clojure-fabric.invalid-argument-exception :as invalid-argument-exception]
            ;; [clojure-fabric.block :as block]
            ;; [clojure-fabric.invalid-protocol-buffer-runtime-exception :as invalid-protocol-buffer-runtime-exception]
            ;; [clojure-fabric.block-deserializer :as block-deserializer]
            ;; [clojure-fabric.invalid-transaction-exception :as invalid-transaction-exception]
            ;; [clojure-fabric.block-event :as block-event]
            ;; [clojure-fabric.invoke-exception :as invoke-exception]
            ;; [clojure-fabric.block-info :as block-info]
            ;; [clojure-fabric.join-peer-proposal-builder :as join-peer-proposal-builder]
            ;; [clojure-fabric.block-listener :as block-listener]
            ;; [clojure-fabric.lscc-proposal-builder :as lscc-proposal-builder]
            ;; [clojure-fabric.chaincode-action-deserializer :as chaincode-action-deserializer]
            ;; [clojure-fabric.no-available-t-cert-exception :as no-available-t-cert-exception]
            ;; [clojure-fabric.chaincode-action-payload-deserializer :as chaincode-action-payload-deserializer]
            ;; [clojure-fabric.no-valid-peer-exception :as no-valid-peer-exception]
            ;; [clojure-fabric.chaincode :as chaincode]
            ;; [clojure-fabric.orderer-client :as orderer-client]
            ;; [clojure-fabric.chaincode-endorsed-action-deserializer :as chaincode-endorsed-action-deserializer]
            ;; [clojure-fabric.orderer :as orderer]
            ;; [clojure-fabric.chaincode-endorsement-policy :as chaincode-endorsement-policy]
            ;; [clojure-fabric.payload-deserializer :as payload-deserializer]
            ;; [clojure-fabric.chaincode-endorsement-policy-parse-exception :as chaincode-endorsement-policy-parse-exception]
            ;; [clojure-fabric.peer :as peer]
            ;; [clojure-fabric.chaincode-exception :as chaincode-exception]
            ;; [clojure-fabric.peer-exception :as peer-exception]            
            ;; [clojure-fabric.proposal-builder :as proposal-builder]
            ;; [clojure-fabric.chaincode-input-deserializer :as chaincode-input-deserializer]
            ;; [clojure-fabric.proposal-exception :as proposal-exception]
            ;; [clojure-fabric.chaincode-invocation-spec-deserializer :as chaincode-invocation-spec-deserializer]
            ;; [clojure-fabric.proposal-response :as proposal-response]
            ;; [clojure-fabric.chaincode-language :as chaincode-language]
            ;; [clojure-fabric.proposal-response-payload-deserializer :as proposal-response-payload-deserializer]
            ;; [clojure-fabric.chaincode-proposal-payload-deserializer :as chaincode-proposal-payload-deserializer]
            ;; [clojure-fabric.proto-utils :as proto-utils]
            ;; [clojure-fabric.chaincode-response :as chaincode-response]
            ;; [clojure-fabric.query-exception :as query-exception]
            ;; [clojure-fabric.channel-configuration :as channel-configuration]
            ;; [clojure-fabric.query-installed-chaincodes-builder :as query-installed-chaincodes-builder]
            ;; [clojure-fabric.channel-header-deserializer :as channel-header-deserializer]
            ;; [clojure-fabric.query-instantiated-chaincodes-builder :as query-instantiated-chaincodes-builder]
            ;; [clojure-fabric.client :as client]
            ;; [clojure-fabric.query-peer-channels-builder :as query-peer-channels-builder]
            ;; [clojure-fabric.config :as config]
            ;; [clojure-fabric.query-scc-request :as query-scc-request]
            ;; [clojure-fabric.core :as core]
            ;; [clojure-fabric.request :as request]
            ;; [clojure-fabric.crypto-exception :as crypto-exception]
            ;; [clojure-fabric.response :as response]
            ;; [clojure-fabric.crypto-primitives :as crypto-primitives]
            ;; [clojure-fabric.sdk-utils :as sdk-utils]
            ;; [clojure-fabric.transaction-action-deserializer :as transaction-action-deserializer]
            ;; [clojure-fabric.cscc-proposal-builder :as cscc-proposal-builder]
            ;; [clojure-fabric.transaction-builder :as transaction-builder]
            ;; [clojure-fabric.diagnostic-file-dumper :as diagnostic-file-dumper]
            ;; [clojure-fabric.transaction-context :as transaction-context]
            ;; [clojure-fabric.endorser-client :as endorser-client]
            ;; [clojure-fabric.transaction-deserializer :as transaction-deserializer]
            ;; [clojure-fabric.endorser-transaction-env-deserializer :as endorser-transaction-env-deserializer]
            ;; [clojure-fabric.transaction-event-exception :as transaction-event-exception]
            ;; [clojure-fabric.endpoint :as endpoint]
            ;; [clojure-fabric.transaction-exception :as transaction-exception]
            ;; [clojure-fabric.enrollment :as enrollment]
            ;; [clojure-fabric.transaction-info :as transaction-info]
            ;; [clojure-fabric.envelope-deserializer :as envelope-deserializer]
            ;; [clojure-fabric.transaction-payload-deserializer :as transaction-payload-deserializer]
            ;; [clojure-fabric.event-hub :as event-hub]
            ;; [clojure-fabric.transaction-proposal-request :as transaction-proposal-request]
            ;; [clojure-fabric.event-hub-exception :as event-hub-exception]
            ;; [clojure-fabric.execute-exception :as execute-exception]
            ;; [clojure-fabric.tx-read-write-set-info :as tx-read-write-set-info]
            ;; [clojure-fabric.get-t-cert-batch-exception :as get-t-cert-batch-exception]
            ;; [clojure-fabric.update-channel-configuration :as update-channel-configuration]
            ;; [clojure-fabric.header-deserializer :as header-deserializer]
            ;; [clojure-fabric.upgrade-proposal-builder :as upgrade-proposal-builder]
            ;; [clojure-fabric.upgrade-proposal-request :as upgrade-proposal-request]
            ;; [clojure-fabric.install-proposal-builder :as install-proposal-builder]
            ;; [clojure-fabric.user :as user]
            ;; [clojure-fabric.install-proposal-request :as install-proposal-request]
            ;; [clojure-fabric.utils :as utils]
            ;; [clojure-fabric.instantiate-proposal-builder :as instantiate-proposal-builder]
            ;; [clojure-fabric.block :as block]
            )
  
  (:import [org.hyperledger.fabric.sdk User Enrollment Peer Orderer]
           [org.bouncycastle.jcajce.provider.asymmetric.ec BCECPrivateKey]))

