Skip to content

Commit

Permalink
Use util/stringify-keys instead of clojure.walk
Browse files Browse the repository at this point in the history
  • Loading branch information
cap10morgan committed Feb 7, 2023
1 parent b82595f commit ca0c481
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/fluree/db/json_ld/commit.cljc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(ns fluree.db.json-ld.commit
(:require [clojure.walk :as walk]
[fluree.json-ld :as json-ld]
(:require [fluree.json-ld :as json-ld]
[fluree.crypto :as crypto]
[fluree.db.flake :as flake]
[fluree.db.constants :as const]
Expand Down Expand Up @@ -360,7 +359,7 @@
(let [context (get commit (keyword const/iri-default-context))
stringify? (-> context keys first keyword?) ; (too?) simple check if we need to stringify the keys before storing
context-str (if stringify?
(walk/stringify-keys context)
(util/stringify-keys context)
context)
{:keys [address]} (<? (conn-proto/-ctx-write conn ledger context-str))]
(assoc commit (keyword const/iri-default-context) address))))
Expand Down
5 changes: 2 additions & 3 deletions src/fluree/db/ledger/json_ld.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
[clojure.string :as str]
[fluree.db.indexer.proto :as idx-proto]
[fluree.db.util.core :as util]
[fluree.db.util.log :as log]
[clojure.walk :as walk])
[fluree.db.util.log :as log])
(:refer-clojure :exclude [load]))

#?(:clj (set! *warn-on-reflection* true))
Expand All @@ -27,7 +26,7 @@
;; default branch
(get branches branch))
context-kw (json-ld/parse-context context)
context-str (-> context walk/stringify-keys json-ld/parse-context)]
context-str (-> context util/stringify-keys json-ld/parse-context)]
(-> branch
(assoc-in [:latest-db :schema :context] context-kw)
(assoc-in [:latest-db :schema :context-str] context-str))))
Expand Down

0 comments on commit ca0c481

Please sign in to comment.