         (.build))))
 
 (defn make-config-update
-  [& {:keys [channel-id read-set write-set type isolated-data]}]
+  [& {:keys [channel-id read-set write-set type isolated-data]
+      :or {isolated-data {}}}]
   (map->ConfigUpdate {:channel-id channel-id :read-set read-set
                       :write-set write-set :type type
                       :isolated-data isolated-data}))

  (clj->proto [this]
    (-> (Configtx$ConfigValue/newBuilder)
        (.setVersion version)
        (.setValue value)
        (.setModPolicy mod-policy)
        (.build))))


  (clj->proto [this]
    (-> (Configtx$ConfigGroup/newBuilder)
        (.setVersion version)
        (.putAllGroups (utils/map-vals #(clj->proto %) groups))
        (.putAllValues (utils/map-vals #(clj->proto %) values))
        (.putAllPolicies (utils/map-vals #(clj->proto %) policies))
        (.setModPolicy mod-policy)
        (.build))))

(defn make-config-group
  [& {:keys [version groups values policies mod-policy]
      :or {groups {} values {} policies {}}}]
  (map->ConfigGroup {:version version :groups groups :values values
                     :policies policies :mod-policy mod-policy}))

(defrecord ConfigUpdate [channel-id read-set write-set type isolated-data]
  ICljToProto
