Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 32 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ holochain_conductor_api = "0.4.1"
holochain_types = "0.4.1"
holochain_websocket = "0.4.1"
serde = { version = "=1.0.203", features = ["derive"] }
serde_json = "1.0.140"
serde_json = { version = "1.0.140", git = "https://github.com/ThetaSinner/json.git", branch = "master" }
thiserror = "2.0.11"
tokio = { version = "1.43.0", features = ["rt-multi-thread", "macros", "net"] }
tracing = "0.1.41"
Expand Down
11 changes: 11 additions & 0 deletions src/transcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ mod tests {
};
use assert2::let_assert;
use base64::{prelude::BASE64_URL_SAFE, Engine};
use holochain_types::dna::ActionHash;
use holochain_types::prelude::ExternIO;
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -125,4 +126,14 @@ mod tests {
let expected_json_response = serde_json::to_string(&response).unwrap();
assert_eq!(json_response, expected_json_response);
}

// TODO requires https://github.com/serde-rs/json/pull/1247
#[test]
fn deserialize_binary() {
let output = ExternIO::encode(ActionHash::from_raw_32(vec![2; 32])).unwrap();

let json = hsb_to_json(&output).unwrap();

assert_eq!(json, "[132,41,36,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,32,73,61,253]");
}
}