 
 (defn make-config-group
   [& {:keys [version groups values poilices mod-policy]}]
-  (map->ConfigUpdate {:version version :groups groups :values values
-                      :poilices poilices :mod-policy mod-policy}))
+  (map->ConfigGroup {:version version :groups groups :values values
+                     :poilices poilices :mod-policy mod-policy}))
 
 (defrecord ConfigUpdate [channel-id read-set write-set type isolated-data]
   ICljToProto

                                               channel-header)
                   :signature-header (when-not (.isEmpty raw-signature-header)
                                       (proto->clj raw-signature-header signature-header)))))

  Configtx$ConfigGroup
  (proto->clj [this ignore]
    (make-config-group :version (.getVersion this) :groups (.getGroups this)
                       :values (.getValues this) :poilices (.getPolicies this)
                       :mod-policy (.getModPolicy this)))
  
  Configtx$ConfigUpdate

  [& {:keys [signature-header signature]}]
  (map->ConfigSignature {:signature-header signature-header :signature signature}))

(defrecord ConfigValue
    [^Long version ^bytes value ^String mod-policy]
  ICljToProto
  (clj->proto [this]
    (-> (Configtx$ConfigValue/newBuilder)
        (.setVersion version)
        (.setValue value)
        (.setModPolicy mod-policy)
        (.build))))

(defn make-config-value
  [& {:keys [version value mod-policy]}]
  (map->ConfigValue {:version version :value value :mod-policy mod-policy}))

(defrecord Policy [^Long type ^bytes value]
  ICljToProto
  (clj->proto [this]
    (-> (Policies$Policy/newBuilder)
        (.setType type)
        (.setValue value)
        (.build))))

(defn make-policy
  [& {:keys [type value]}]
  (map->Policy {:type type :value value}))

(defrecord ConfigPolicy [^Long version ^Policies$Policy policy ^String mod-policy]
  ICljToProto
  (clj->proto [this]
    (-> (Configtx$ConfigPolicy/newBuilder)
        (.setVersion version)
        (.setPolicy policy)
        (.setModPolicy mod-policy)
        (.build))))

(defn make-config-policy
  [& {:keys [version policy mod-policy]}]
  (map->ConfigValue {:version version :policy policy :mod-policy mod-policy}))

(defrecord ConfigGroup [version groups values policies mod-policy]
  ICljToProto
