.network(Network::Testnet) .build(); let tempdir = TempDir::new().unwrap(); let cookie_file = tempdir.path().join(".cookie"); fs::write(&cookie_file, "username:password").unwrap(); let options = Options::try_parse_from([ "ord", "--cookie-file", cookie_file.to_str().unwrap(), "--rpc-url", &rpc_server.url(), ]) .unwrap(); assert_eq!( options.bitcoin_rpc_client().unwrap_err().to_string(), "Bitcoin RPC server is on testnet but ord is on mainnet" ); } #[test] fn chain_flags() { Arguments::try_parse_from(["ord", "--signet", "--chain", "signet", "index", "update"]) .unwrap_err(); assert_eq!( Arguments::try_parse_from(["ord", "--signet", "index", "update"]) .unwrap() .options .chain(), Chain::Signet ); assert_eq!( Arguments::try_parse_from(["ord", "-s", "index", "update"]) .unwrap() .options .chain(), Chain::Signet ); Arguments::try_parse_from(["ord", "--regtest", "--chain", "signet", "index", "update"])