Skip to content

Commit 5e9a67e

Browse files
committed
add commit address to commit maps after reading
1 parent b12b458 commit 5e9a67e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/fluree/db/commit/storage.cljc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
(go-try
5353
(when-let [[commit _proof] (<? (read-verified-commit storage commit-address))]
5454
(let [commit-id (commit-data/hash->commit-id commit-hash)]
55-
(assoc commit :id commit-id)))))
55+
(assoc commit
56+
:id commit-id
57+
const/iri-address commit-address)))))
5658

5759
(defn read-data-jsonld
5860
[storage address]

src/fluree/db/connection.cljc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@
117117
(if-let [expanded-commit (<? (commit-storage/read-commit-jsonld commit-catalog address hash))]
118118
(if-let [ledger-alias (get-first-value expanded-commit const/iri-alias)]
119119
(if-let [ledger-ch (cached-ledger conn ledger-alias)]
120-
(do (log/debug "Notification received for ledger" ledger-alias "of new commit:" expanded-commit)
121-
(let [db-address (-> expanded-commit
120+
(do (log/debug "Notification received for ledger" ledger-alias
121+
"of new commit:" expanded-commit)
122+
(let [ledger (<? ledger-ch)
123+
db-address (-> expanded-commit
122124
(get-first const/iri-data)
123125
(get-first-value const/iri-address))
124-
expanded-data (<? (commit-storage/read-data-jsonld commit-catalog db-address))
125-
ledger (<? ledger-ch)
126-
status (<? (ledger/notify ledger expanded-commit expanded-data))]
127-
(case status
126+
expanded-data (<? (commit-storage/read-data-jsonld commit-catalog db-address))]
127+
(case (<? (ledger/notify ledger expanded-commit expanded-data))
128128
(::ledger/current ::ledger/newer ::ledger/updated)
129129
(do (log/debug "Ledger" ledger-alias "is up to date")
130130
true)

0 commit comments

Comments
 (0)