Skip to content

Commit

Permalink
workaround for serde_json deserialization of ChainConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 committed Nov 10, 2023
1 parent 79ef3ca commit 9d38a04
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 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 crates/relayer-rest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ tokio = "1.26"

[dev-dependencies]
reqwest = { version = "0.11.16", features = ["json"], default-features = false }
toml = "0.7.3"
serde_json = "1"
toml = "0.7.3"
5 changes: 4 additions & 1 deletion crates/relayer-rest/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ where
let response = reqwest::get(&format!("http://127.0.0.1:{port}{path}"))
.await
.unwrap()
.json::<R>()
.json()
.await
.unwrap();
// Workaround for serde_json deserialization failure
// from_str/from_slice() failed for ChainConfig
let response = serde_json::from_value::<R>(response).unwrap();

assert_eq!(response, expected);

Expand Down

0 comments on commit 9d38a04

Please sign in to comment.