summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--adenosine/src/ipld.rs4
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cc5a3a1..4ea0924 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,7 @@ helpers, and probably client code and generated Lexicon code there.
behavior)
- repo: MST keys should not have leading `/` before collection NSID (following
upstream behavior)
+- ipld conversion: fix 'car' vs. 'cid' typo in special-case handling
## [0.2.0] - 2022-12-19
diff --git a/adenosine/src/ipld.rs b/adenosine/src/ipld.rs
index 65a56e4..63f29dc 100644
--- a/adenosine/src/ipld.rs
+++ b/adenosine/src/ipld.rs
@@ -24,7 +24,7 @@ pub fn ipld_into_json_value(val: Ipld) -> Value {
/// Crude reverse generation
///
/// Does not handle base64 to bytes, and the link generation is pretty simple (object elements with
-/// key "car"). Numbers always come through as f64 (float).
+/// key "cid"). Numbers always come through as f64 (float).
pub fn json_value_into_ipld(val: Value) -> Ipld {
match val {
Value::Null => Ipld::Null,
@@ -35,7 +35,7 @@ pub fn json_value_into_ipld(val: Value) -> Ipld {
Value::Array(l) => Ipld::List(l.into_iter().map(json_value_into_ipld).collect()),
Value::Object(m) => {
let map: BTreeMap<String, Ipld> = BTreeMap::from_iter(m.into_iter().map(|(k, v)| {
- if k == "car" && v.is_string() {
+ if k == "cid" && v.is_string() {
(k, Ipld::Link(Cid::from_str(v.as_str().unwrap()).unwrap()))
} else {
(k, json_value_into_ipld(v))