aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbryan newbold <bnewbold@robocracy.org>2023-03-04 15:52:11 -0800
committerbryan newbold <bnewbold@robocracy.org>2023-03-04 16:29:41 -0800
commita4e160285683021431bcff75f257df654d56e748 (patch)
tree48bbfd7451e3f17ad8e02b7916524f47c8637dc9
parent0c9b360d023027d3dfa364eb7627e6bfee322613 (diff)
downloadadenosine-a4e160285683021431bcff75f257df654d56e748.tar.gz
adenosine-a4e160285683021431bcff75f257df654d56e748.zip
fix typo in IPLD conversion ('cid' not 'car')
-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))