} } Ok(client) } } #[cfg(test)] mod tests { use {super::*, bitcoin::Network, std::path::Path}; #[test] fn rpc_url_overrides_network() { assert_eq!( Arguments::try_parse_from([ "ord", "--rpc-url=127.0.0.1:1234", "--chain=signet", "index", "update" ]) .unwrap() .options .rpc_url(), "127.0.0.1:1234/wallet/ord" ); } #[test] fn cookie_file_overrides_network() { assert_eq!( Arguments::try_parse_from([ "ord", "--cookie-file=/foo/bar", "--chain=signet", "index", "update" ]) .unwrap() .options .cookie_file() .unwrap(), Path::new("/foo/bar") ); } #[test] fn use_default_network() { let arguments = Arguments::try_parse_from(["ord", "index", "update"]).unwrap(); assert_eq!(arguments.options.rpc_url(), "127.0.0.1:8332/wallet/ord"); assert!(arguments .options .cookie_file() .unwrap()