Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List transaction outputs #292

Merged
merged 12 commits into from
Aug 7, 2022
Prev Previous commit
Next Next commit
Add cookie file tests
  • Loading branch information
casey committed Aug 6, 2022
commit f9ce8ed653d45898fe8076357d1992532da3cbcc
36 changes: 36 additions & 0 deletions src/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,40 @@ mod tests {
.to_string()
.ends_with("/signet/.cookie"))
}

#[test]
fn mainnet_cookie_file_path() {
let arguments = Arguments::try_parse_from(&["ord", "index"]).unwrap();

let cookie_file = arguments
.options
.cookie_file()
.unwrap()
.display()
.to_string();

if cfg!(target_os = "linux") {
assert!(cookie_file.ends_with("/.bitcoin/.cookie"));
} else {
assert!(cookie_file.ends_with("/Bitcoin/.cookie"));
}
}

#[test]
fn othernet_cookie_file_path() {
let arguments = Arguments::try_parse_from(&["ord", "--network=signet", "index"]).unwrap();

let cookie_file = arguments
.options
.cookie_file()
.unwrap()
.display()
.to_string();

if cfg!(target_os = "linux") {
assert!(cookie_file.ends_with("/.bitcoin/signet/.cookie"));
} else {
assert!(cookie_file.ends_with("/Bitcoin/signet/.cookie"));
}
}
}