Skip to content

Commit 81d1a1f

Browse files
committed
Read ohttp-keys from file for test
1 parent be6c9ef commit 81d1a1f

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

payjoin/tests/integration.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,10 @@ mod integration {
209209

210210
#[tokio::test]
211211
async fn test_bad_ohttp_keys() {
212-
let bad_ohttp_keys = OhttpKeys::decode(
213-
&base64::decode_config(
214-
"AQAg3WpRjS0aqAxQUoLvpas2VYjT2oIg6-3XSiB-QiYI1BAABAABAAM",
215-
base64::URL_SAFE,
216-
)
217-
.expect("invalid base64"),
218-
)
219-
.expect("Invalid OhttpKeys");
212+
let mut path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
213+
path.push("tests/ohttp-keys");
214+
let file_content = std::fs::read(&path).expect("Failed to read the 'ohttp-keys' file");
215+
let bad_ohttp_keys = OhttpKeys::decode(&file_content).expect("Invalid OhttpKeys");
220216

221217
std::env::set_var("RUST_LOG", "debug");
222218
let (cert, key) = local_cert_key();

payjoin/tests/ohttp-keys

41 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)