Skip to content

Commit

Permalink
Fix data forms for mock responses
Browse files Browse the repository at this point in the history
  • Loading branch information
dfinity-ryancroote committed Nov 16, 2023
1 parent 4339061 commit 4de420b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
29 changes: 15 additions & 14 deletions src/xrc-tests/src/mock_responses/exchanges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,21 @@ where
(timestamp * 1_000) as i64,
1677584399999i64
]]),
Exchange::Bybit(_) => json!([[
(timestamp * 1_000) as i64,
rate,
"1.00",
"1.00",
"1.00",
"1.00",
1637161979999i64,
"1.00",
63,
"1.00",
"1.00",
"0"
]]),
Exchange::Bybit(_) => json!({
"result": {
"list": [
[
(timestamp * 1_000).to_string(),
rate,
"1.00",
"1.00",
"1.00",
"1.00",
"1.00",
]
]
}
}),
};
let bytes = serde_json::to_vec(&json).expect("Failed to build exchange response.");
ResponseBody::Json(bytes)
Expand Down
29 changes: 15 additions & 14 deletions src/xrc-tests/src/mock_responses/stablecoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,21 @@ fn sample_stablecoin_json(exchange: &Exchange) -> ResponseBody {
1677584340000i64,
1677584399999i64
]]),
Exchange::Bybit(_) => json!([[
1614596340000i64,
"0.99",
"1.00",
"1.00",
"1.00",
"1.00",
1637161979999i64,
"1.00",
63,
"1.00",
"1.00",
"0"
]]),
Exchange::Bybit(_) => json!({
"result": {
"list": [
[
"1614596340000",
"0.99",
"1.00",
"1.00",
"1.00",
"1.00",
"1.00",
]
]
}
}),
};
ResponseBody::Json(serde_json::to_vec(&json).expect("Failed to encode JSON to bytes"))
}
Expand Down

0 comments on commit 4de420b

Please sign in to comment.