diff --git a/deploy/ord.service b/deploy/ord.service index c795ef06d6..d43f14b810 100644 --- a/deploy/ord.service +++ b/deploy/ord.service @@ -19,7 +19,8 @@ ExecStart=/usr/local/bin/ord \ --acme-contact mailto:casey@rodarmor.com \ --csp-origin https://${CSP_ORIGIN} \ --http \ - --https + --https \ + --disable-json-api Group=ord LimitNOFILE=65536 MemoryDenyWriteExecute=true diff --git a/docs/src/guides/explorer.md b/docs/src/guides/explorer.md index ad5cc9cbcb..1f805f2714 100644 --- a/docs/src/guides/explorer.md +++ b/docs/src/guides/explorer.md @@ -14,10 +14,10 @@ To specify a port add the `--http-port` flag: `ord server --http-port 8080` -To enable the JSON-API endpoints add the `--enable-json-api` or `-j` flag (see -[here](#json-api) for more info): +The JSON-API endpoints are enabled by default, to disable them add the +`--disable-json-api` flag (see [here](#json-api) for more info): -`ord server --enable-json-api` +`ord server --disable-json-api` Search ------ @@ -72,7 +72,7 @@ been issued when they are mined: JSON-API -------- -You can run `ord server` with the `--enable-json-api` flag to access endpoints that +By default the `ord server` gives access to endpoints that return JSON instead of HTML if you set the HTTP `Accept: application/json` header. The structure of these objects closely follows what is shown in the HTML. These endpoints are: diff --git a/src/server_config.rs b/src/server_config.rs index 86b363dc5b..b22688d880 100644 --- a/src/server_config.rs +++ b/src/server_config.rs @@ -7,5 +7,5 @@ pub(crate) struct ServerConfig { pub(crate) decompress: bool, pub(crate) domain: Option, pub(crate) index_sats: bool, - pub(crate) is_json_api_enabled: bool, + pub(crate) json_api_enabled: bool, } diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index 4655416e05..52c138b2b5 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -162,8 +162,8 @@ pub struct Server { pub(crate) https: bool, #[arg(long, help = "Redirect HTTP traffic to HTTPS.")] pub(crate) redirect_http_to_https: bool, - #[arg(long, short = 'j', help = "Enable JSON API.")] - pub(crate) enable_json_api: bool, + #[arg(long, help = "Disable JSON API.")] + pub(crate) disable_json_api: bool, #[arg( long, help = "Decompress encoded content. Currently only supports brotli. Be careful using this on production instances. A decompressed inscription may be arbitrarily large, making decompression a DoS vector." @@ -206,7 +206,7 @@ impl Server { csp_origin: self.csp_origin.clone(), domain: acme_domains.first().cloned(), index_sats: index.has_sat_index(), - is_json_api_enabled: self.enable_json_api, + json_api_enabled: !self.disable_json_api, decompress: self.decompress, }); @@ -1665,7 +1665,7 @@ mod tests { .build(), None, &["--chain", "regtest"], - &["--enable-json-api"], + &[], ) } @@ -1687,7 +1687,7 @@ mod tests { .build(), None, &["--chain", "regtest", "--index-runes"], - &["--enable-json-api"], + &[], ) } diff --git a/src/subcommand/server/accept_encoding.rs b/src/subcommand/server/accept_encoding.rs index 9aff921693..0143339a59 100644 --- a/src/subcommand/server/accept_encoding.rs +++ b/src/subcommand/server/accept_encoding.rs @@ -57,7 +57,7 @@ mod tests { let encodings = AcceptEncoding::from_request_parts( &mut req.into_parts().0, &Arc::new(ServerConfig { - is_json_api_enabled: false, + json_api_enabled: false, decompress: false, ..Default::default() }), @@ -78,7 +78,7 @@ mod tests { let encodings = AcceptEncoding::from_request_parts( &mut req.into_parts().0, &Arc::new(ServerConfig { - is_json_api_enabled: false, + json_api_enabled: false, decompress: false, ..Default::default() }), @@ -107,7 +107,7 @@ mod tests { let encodings = AcceptEncoding::from_request_parts( &mut req.into_parts().0, &Arc::new(ServerConfig { - is_json_api_enabled: false, + json_api_enabled: false, decompress: false, ..Default::default() }), diff --git a/src/subcommand/server/accept_json.rs b/src/subcommand/server/accept_json.rs index a471c3d049..c748baf97e 100644 --- a/src/subcommand/server/accept_json.rs +++ b/src/subcommand/server/accept_json.rs @@ -15,7 +15,7 @@ where state: &S, ) -> Result { let state = Arc::from_ref(state); - let json_api_enabled = state.is_json_api_enabled; + let json_api_enabled = state.json_api_enabled; let json_header = parts .headers .get("accept") @@ -24,7 +24,7 @@ where if json_header && json_api_enabled { Ok(Self(true)) } else if json_header && !json_api_enabled { - Err((StatusCode::NOT_ACCEPTABLE, "JSON API not enabled")) + Err((StatusCode::NOT_ACCEPTABLE, "JSON API disabled")) } else { Ok(Self(false)) } diff --git a/tests/balances.rs b/tests/balances.rs index 4deb478dfc..79de88aae7 100644 --- a/tests/balances.rs +++ b/tests/balances.rs @@ -37,11 +37,8 @@ fn with_runes() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/decode.rs b/tests/decode.rs index 04693aedb1..d27d855d8b 100644 --- a/tests/decode.rs +++ b/tests/decode.rs @@ -93,7 +93,7 @@ fn from_stdin() { #[test] fn from_core() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/etch.rs b/tests/etch.rs index 73226e3982..2b9c5edef5 100644 --- a/tests/etch.rs +++ b/tests/etch.rs @@ -12,8 +12,7 @@ fn flag_is_required() { .network(Network::Regtest) .build(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest"], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -34,11 +33,8 @@ fn divisibility_over_max_is_an_error() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -62,11 +58,8 @@ fn supply_over_max_is_an_error() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -90,11 +83,8 @@ fn rune_below_minimum_is_an_error() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -118,11 +108,8 @@ fn reserved_rune_is_an_error() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -144,11 +131,8 @@ fn trying_to_etch_an_existing_rune_is_an_error() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -174,11 +158,8 @@ fn runes_can_be_etched() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -237,11 +218,8 @@ fn etch_sets_integer_fee_rate_correctly() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -273,11 +251,8 @@ fn etch_sets_decimal_fee_rate_correctly() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -309,11 +284,8 @@ fn etch_does_not_select_inscribed_utxos() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -359,11 +331,8 @@ fn inscribe_does_not_select_runic_utxos() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -404,11 +373,8 @@ fn send_amount_does_not_select_runic_utxos() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -439,11 +405,8 @@ fn send_satpoint_does_not_send_runic_utxos() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -474,11 +437,8 @@ fn send_inscription_does_not_select_runic_utxos() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/index.rs b/tests/index.rs index 9a9a3f3ab7..5d44449cac 100644 --- a/tests/index.rs +++ b/tests/index.rs @@ -84,7 +84,7 @@ fn index_runs_with_rpc_user_and_pass_as_env_vars() { #[test] fn export_inscription_number_to_id_tsv() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/json_api.rs b/tests/json_api.rs index 15b283dc85..ff16c9c4d5 100644 --- a/tests/json_api.rs +++ b/tests/json_api.rs @@ -4,9 +4,8 @@ use {super::*, bitcoin::BlockHash}; fn get_sat_without_sat_index() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let response = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]) - .json_request("/sat/2099999997689999"); + let response = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]) + .json_request("/sat/2099999997689999"); assert_eq!(response.status(), StatusCode::OK); @@ -40,11 +39,8 @@ fn get_sat_without_sat_index() { fn get_sat_with_inscription_and_sat_index() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -81,11 +77,8 @@ fn get_sat_with_inscription_and_sat_index() { fn get_sat_with_inscription_on_common_sat_and_more_inscriptions() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -140,11 +133,8 @@ fn get_sat_with_inscription_on_common_sat_and_more_inscriptions() { fn get_inscription() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -187,11 +177,8 @@ fn get_inscription() { fn get_inscriptions() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -247,7 +234,7 @@ fn get_inscriptions_in_block() { let ord_rpc_server = TestServer::spawn_with_server_args( &bitcoin_rpc_server, &["--index-sats", "--first-inscription-height", "0"], - &["--enable-json-api"], + &[], ); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -301,7 +288,7 @@ fn get_inscriptions_in_block() { #[test] fn get_output() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); bitcoin_rpc_server.mine_blocks(3); @@ -319,11 +306,8 @@ fn get_output() { bitcoin_rpc_server.mine_blocks(1); - let server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--no-sync", "--enable-json-api"], - ); + let server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &["--no-sync"]); let response = reqwest::blocking::Client::new() .get(server.url().join(&format!("/output/{}:0", txid)).unwrap()) @@ -339,11 +323,7 @@ fn get_output() { .indexed ); - let server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); let response = server.json_request(format!("/output/{}:0", txid)); assert_eq!(response.status(), StatusCode::OK); @@ -375,11 +355,12 @@ fn get_output() { } #[test] -fn json_request_fails_when_not_enabled() { +fn json_request_fails_when_disabled() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); let response = - TestServer::spawn_with_args(&bitcoin_rpc_server, &[]).json_request("/sat/2099999997689999"); + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--disable-json-api"]) + .json_request("/sat/2099999997689999"); assert_eq!(response.status(), StatusCode::NOT_ACCEPTABLE); } @@ -391,8 +372,7 @@ fn get_block() { bitcoin_rpc_server.mine_blocks(1); let response = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]) - .json_request("/block/0"); + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]).json_request("/block/0"); assert_eq!(response.status(), StatusCode::OK); @@ -417,7 +397,7 @@ fn get_block() { #[test] fn get_blocks() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); let blocks: Vec = bitcoin_rpc_server .mine_blocks(101) @@ -453,7 +433,7 @@ fn get_blocks() { fn get_transaction() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); let transaction = bitcoin_rpc_server.mine_blocks(1)[0].txdata[0].clone(); @@ -484,7 +464,7 @@ fn get_status() { let ord_rpc_server = TestServer::spawn_with_server_args( &bitcoin_rpc_server, &["--regtest", "--index-sats", "--index-runes"], - &["--enable-json-api"], + &[], ); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -534,11 +514,8 @@ fn get_runes() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-runes", "--regtest"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-runes", "--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/runes.rs b/tests/runes.rs index 2b3c529334..4437089781 100644 --- a/tests/runes.rs +++ b/tests/runes.rs @@ -6,8 +6,7 @@ fn flag_is_required() { .network(Network::Regtest) .build(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest"], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest"], &[]); CommandBuilder::new("--regtest runes") .bitcoin_rpc_server(&bitcoin_rpc_server) @@ -39,11 +38,8 @@ fn one_rune() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -90,11 +86,8 @@ fn two_runes() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/server.rs b/tests/server.rs index 2449fde82b..cca4cc99b6 100644 --- a/tests/server.rs +++ b/tests/server.rs @@ -40,7 +40,7 @@ fn run() { #[test] fn inscription_page() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -98,7 +98,7 @@ fn inscription_page() { #[test] fn inscription_appears_on_reveal_transaction_page() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -115,7 +115,7 @@ fn inscription_appears_on_reveal_transaction_page() { #[test] fn multiple_inscriptions_appear_on_reveal_transaction_page() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -147,7 +147,7 @@ fn multiple_inscriptions_appear_on_reveal_transaction_page() { #[test] fn inscription_appears_on_output_page() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -164,7 +164,7 @@ fn inscription_appears_on_output_page() { #[test] fn inscription_page_after_send() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -201,7 +201,7 @@ fn inscription_page_after_send() { #[test] fn inscription_content() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -247,7 +247,7 @@ fn inscription_metadata() { ciborium::ser::into_writer(&cbor_map, &mut encoded_metadata).unwrap(); let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -284,7 +284,7 @@ fn inscription_metadata() { #[test] fn inscriptions_page() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -305,7 +305,7 @@ fn inscriptions_page() { #[test] fn inscriptions_page_is_sorted() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -322,7 +322,7 @@ fn inscriptions_page_is_sorted() { #[test] fn inscriptions_page_has_next_and_previous() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -484,11 +484,8 @@ fn sat_recursive_endpoints_without_sat_index_return_404() { fn inscription_transactions_are_stored_with_transaction_index() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-transactions"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-transactions"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/test_server.rs b/tests/test_server.rs index 6637d0653c..e027914f17 100644 --- a/tests/test_server.rs +++ b/tests/test_server.rs @@ -17,6 +17,10 @@ pub(crate) struct TestServer { } impl TestServer { + pub(crate) fn spawn(bitcoin_rpc_server: &test_bitcoincore_rpc::Handle) -> Self { + Self::spawn_with_server_args(bitcoin_rpc_server, &[], &[]) + } + pub(crate) fn spawn_with_args( bitcoin_rpc_server: &test_bitcoincore_rpc::Handle, ord_args: &[&str], @@ -24,10 +28,6 @@ impl TestServer { Self::spawn_with_server_args(bitcoin_rpc_server, ord_args, &[]) } - pub(crate) fn spawn_with_json_api(bitcoin_rpc_server: &test_bitcoincore_rpc::Handle) -> Self { - Self::spawn_with_server_args(bitcoin_rpc_server, &[], &["--enable-json-api"]) - } - pub(crate) fn spawn_with_server_args( bitcoin_rpc_server: &test_bitcoincore_rpc::Handle, ord_args: &[&str], diff --git a/tests/wallet/balance.rs b/tests/wallet/balance.rs index 5e60fd6b2b..120029a895 100644 --- a/tests/wallet/balance.rs +++ b/tests/wallet/balance.rs @@ -4,8 +4,7 @@ use {super::*, ord::subcommand::wallet::balance::Output}; fn wallet_balance() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -39,8 +38,7 @@ fn wallet_balance() { fn inscribed_utxos_are_deducted_from_cardinal() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -81,11 +79,8 @@ fn runic_utxos_are_deducted_from_cardinal() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--regtest", "--index-runes"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest", "--index-runes"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -122,7 +117,7 @@ fn runic_utxos_are_deducted_from_cardinal() { #[test] fn unsynced_wallet_fails_with_unindexed_output() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); bitcoin_rpc_server.mine_blocks(1); @@ -142,11 +137,8 @@ fn unsynced_wallet_fails_with_unindexed_output() { } ); - let no_sync_ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &[], - &["--no-sync", "--enable-json-api"], - ); + let no_sync_ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--no-sync"]); inscribe(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/wallet/cardinals.rs b/tests/wallet/cardinals.rs index b2815b36ef..f33896cb5e 100644 --- a/tests/wallet/cardinals.rs +++ b/tests/wallet/cardinals.rs @@ -7,8 +7,7 @@ use { fn cardinals() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/wallet/inscribe.rs b/tests/wallet/inscribe.rs index d7fb538faa..31c85daa40 100644 --- a/tests/wallet/inscribe.rs +++ b/tests/wallet/inscribe.rs @@ -7,7 +7,7 @@ use { #[test] fn inscribe_creates_inscriptions() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); bitcoin_rpc_server.mine_blocks(1); @@ -32,7 +32,7 @@ fn inscribe_creates_inscriptions() { #[test] fn inscribe_works_with_huge_expensive_inscriptions() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -50,7 +50,7 @@ fn inscribe_works_with_huge_expensive_inscriptions() { #[test] fn metaprotocol_appears_on_inscription_page() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -75,7 +75,7 @@ fn metaprotocol_appears_on_inscription_page() { #[test] fn inscribe_fails_if_bitcoin_core_is_too_old() { let bitcoin_rpc_server = test_bitcoincore_rpc::builder().version(230000).build(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); CommandBuilder::new("wallet inscribe --file hello.txt --fee-rate 1") .write("hello.txt", "HELLOWORLD") @@ -89,7 +89,7 @@ fn inscribe_fails_if_bitcoin_core_is_too_old() { #[test] fn inscribe_no_backup() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); bitcoin_rpc_server.mine_blocks(1); @@ -109,7 +109,7 @@ fn inscribe_no_backup() { #[test] fn inscribe_unknown_file_extension() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -151,8 +151,7 @@ fn regtest_has_no_content_size_limit() { .network(Network::Regtest) .build(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest"], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -172,7 +171,7 @@ fn mainnet_has_no_content_size_limit() { .network(Network::Bitcoin) .build(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -189,7 +188,7 @@ fn mainnet_has_no_content_size_limit() { #[test] fn inscribe_does_not_use_inscribed_sats_as_cardinal_utxos() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -209,7 +208,7 @@ fn inscribe_does_not_use_inscribed_sats_as_cardinal_utxos() { #[test] fn refuse_to_reinscribe_sats() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -233,7 +232,7 @@ fn refuse_to_reinscribe_sats() { #[test] fn refuse_to_inscribe_already_inscribed_utxo() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -260,11 +259,8 @@ fn refuse_to_inscribe_already_inscribed_utxo() { #[test] fn inscribe_with_optional_satpoint_arg() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -293,11 +289,8 @@ fn inscribe_with_optional_satpoint_arg() { fn inscribe_with_fee_rate() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -350,11 +343,8 @@ fn inscribe_with_fee_rate() { #[test] fn inscribe_with_commit_fee_rate() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -401,8 +391,7 @@ fn inscribe_with_commit_fee_rate() { #[test] fn inscribe_with_wallet_named_foo() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); CommandBuilder::new("wallet --name foo create") .bitcoin_rpc_server(&bitcoin_rpc_server) @@ -421,8 +410,7 @@ fn inscribe_with_wallet_named_foo() { #[test] fn inscribe_with_dry_run_flag() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -448,8 +436,7 @@ fn inscribe_with_dry_run_flag() { #[test] fn inscribe_with_dry_run_flag_fees_increase() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -477,8 +464,7 @@ fn inscribe_with_dry_run_flag_fees_increase() { #[test] fn inscribe_to_specific_destination() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -511,7 +497,7 @@ fn inscribe_to_specific_destination() { #[test] fn inscribe_to_address_on_different_network() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -531,7 +517,7 @@ fn inscribe_to_address_on_different_network() { #[test] fn inscribe_with_no_limit() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -547,7 +533,7 @@ fn inscribe_with_no_limit() { #[test] fn inscribe_works_with_postage() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); bitcoin_rpc_server.mine_blocks(1); @@ -572,7 +558,7 @@ fn inscribe_works_with_postage() { #[test] fn inscribe_with_non_existent_parent_inscription() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -594,7 +580,7 @@ fn inscribe_with_non_existent_parent_inscription() { #[test] fn inscribe_with_parent_inscription_and_fee_rate() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_json_api(&bitcoin_rpc_server); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -666,11 +652,8 @@ fn inscribe_with_parent_inscription_and_fee_rate() { #[test] fn reinscribe_with_flag() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); bitcoin_rpc_server.mine_blocks(1); @@ -718,8 +701,7 @@ fn reinscribe_with_flag() { fn with_reinscribe_flag_but_not_actually_a_reinscription() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -748,8 +730,7 @@ fn with_reinscribe_flag_but_not_actually_a_reinscription() { fn try_reinscribe_without_flag() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -783,8 +764,7 @@ fn try_reinscribe_without_flag() { fn no_metadata_appears_on_inscription_page_if_no_metadata_is_passed() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -812,8 +792,7 @@ fn no_metadata_appears_on_inscription_page_if_no_metadata_is_passed() { fn json_metadata_appears_on_inscription_page() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -841,8 +820,7 @@ fn json_metadata_appears_on_inscription_page() { #[test] fn cbor_metadata_appears_on_inscription_page() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -906,8 +884,7 @@ fn error_message_when_parsing_cbor_metadata_is_reasonable() { fn batch_inscribe_fails_if_batchfile_has_no_inscriptions() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -927,8 +904,7 @@ fn batch_inscribe_fails_if_batchfile_has_no_inscriptions() { fn batch_inscribe_can_create_one_inscription() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -967,8 +943,7 @@ fn batch_inscribe_can_create_one_inscription() { fn batch_inscribe_with_multiple_inscriptions() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1011,8 +986,7 @@ fn batch_inscribe_with_multiple_inscriptions() { fn batch_inscribe_with_multiple_inscriptions_with_parent() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1063,8 +1037,7 @@ fn batch_inscribe_with_multiple_inscriptions_with_parent() { fn batch_inscribe_respects_dry_run_flag() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1093,8 +1066,7 @@ fn batch_inscribe_respects_dry_run_flag() { fn batch_in_same_output_but_different_satpoints() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1161,8 +1133,7 @@ fn batch_in_same_output_but_different_satpoints() { fn batch_in_same_output_with_non_default_postage() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1229,8 +1200,7 @@ fn batch_in_same_output_with_non_default_postage() { fn batch_in_separate_outputs_with_parent() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1307,8 +1277,7 @@ fn batch_in_separate_outputs_with_parent() { fn batch_in_separate_outputs_with_parent_and_non_default_postage() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1386,8 +1355,7 @@ fn batch_in_separate_outputs_with_parent_and_non_default_postage() { fn inscribe_does_not_pick_locked_utxos() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1409,8 +1377,7 @@ fn inscribe_does_not_pick_locked_utxos() { fn inscribe_can_compress() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1473,8 +1440,7 @@ fn inscribe_can_compress() { fn inscriptions_are_not_compressed_if_no_space_is_saved_by_compression() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1518,8 +1484,7 @@ fn batch_inscribe_fails_if_invalid_network_destination_address() { .network(Network::Regtest) .build(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest"], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1539,8 +1504,7 @@ fn batch_inscribe_fails_if_invalid_network_destination_address() { fn batch_inscribe_fails_with_shared_output_and_destination_set() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1561,8 +1525,7 @@ fn batch_inscribe_fails_with_shared_output_and_destination_set() { fn batch_inscribe_works_with_some_destinations_set_and_others_not() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1613,8 +1576,7 @@ fn batch_inscribe_works_with_some_destinations_set_and_others_not() { fn batch_same_sat() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1679,8 +1641,7 @@ fn batch_same_sat() { fn batch_same_sat_with_parent() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1763,11 +1724,8 @@ fn batch_same_sat_with_parent() { fn inscribe_with_sat_arg() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1797,8 +1755,7 @@ fn inscribe_with_sat_arg() { fn inscribe_with_sat_arg_fails_if_no_index_or_not_found() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1816,7 +1773,7 @@ fn inscribe_with_sat_arg_fails_if_no_index_or_not_found() { .ord_rpc_server(&TestServer::spawn_with_server_args( &bitcoin_rpc_server, &["--index-sats"], - &["--enable-json-api"], + &[], )) .expected_exit_code(1) .expected_stderr("error: could not find sat `5000000000` in wallet outputs\n") @@ -1827,11 +1784,8 @@ fn inscribe_with_sat_arg_fails_if_no_index_or_not_found() { fn batch_inscribe_with_sat_argument_with_parent() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1877,8 +1831,7 @@ fn batch_inscribe_with_sat_argument_with_parent() { fn batch_inscribe_with_sat_arg_fails_if_wrong_mode() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1903,11 +1856,8 @@ fn batch_inscribe_with_sat_arg_fails_if_wrong_mode() { fn batch_inscribe_with_fee_rate() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1965,8 +1915,7 @@ fn batch_inscribe_with_fee_rate() { fn server_can_decompress_brotli() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -2029,8 +1978,7 @@ fn server_can_decompress_brotli() { fn file_inscribe_with_delegate_inscription() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -2060,8 +2008,7 @@ fn file_inscribe_with_delegate_inscription() { fn file_inscribe_with_non_existent_delegate_inscription() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -2084,8 +2031,7 @@ fn file_inscribe_with_non_existent_delegate_inscription() { fn batch_inscribe_with_delegate_inscription() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -2123,8 +2069,7 @@ inscriptions: fn batch_inscribe_with_non_existent_delegate_inscription() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/wallet/inscriptions.rs b/tests/wallet/inscriptions.rs index e7ede054af..89dc79f833 100644 --- a/tests/wallet/inscriptions.rs +++ b/tests/wallet/inscriptions.rs @@ -7,8 +7,7 @@ use { fn inscriptions() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -62,8 +61,7 @@ fn inscriptions() { fn inscriptions_includes_locked_utxos() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -92,8 +90,7 @@ fn inscriptions_includes_locked_utxos() { fn inscriptions_with_postage() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/wallet/outputs.rs b/tests/wallet/outputs.rs index bb8202a141..cc7bd9c824 100644 --- a/tests/wallet/outputs.rs +++ b/tests/wallet/outputs.rs @@ -4,8 +4,7 @@ use {super::*, ord::subcommand::wallet::outputs::Output}; fn outputs() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -26,8 +25,7 @@ fn outputs() { fn outputs_includes_locked_outputs() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -50,8 +48,7 @@ fn outputs_includes_locked_outputs() { fn outputs_includes_unbound_outputs() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/wallet/receive.rs b/tests/wallet/receive.rs index 1d69f47190..55f33c6910 100644 --- a/tests/wallet/receive.rs +++ b/tests/wallet/receive.rs @@ -3,8 +3,7 @@ use {super::*, ord::subcommand::wallet::receive}; #[test] fn receive() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn(&bitcoin_rpc_server); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/wallet/sats.rs b/tests/wallet/sats.rs index 47936fe9c1..86c91c4d66 100644 --- a/tests/wallet/sats.rs +++ b/tests/wallet/sats.rs @@ -7,8 +7,7 @@ use { fn requires_sat_index() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -24,11 +23,8 @@ fn requires_sat_index() { fn sats() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -47,11 +43,8 @@ fn sats() { fn sats_from_tsv_success() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -71,11 +64,8 @@ fn sats_from_tsv_success() { fn sats_from_tsv_parse_error() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -94,11 +84,8 @@ fn sats_from_tsv_parse_error() { fn sats_from_tsv_file_not_found() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/wallet/send.rs b/tests/wallet/send.rs index 2d2ce4dc00..293b6b6c88 100644 --- a/tests/wallet/send.rs +++ b/tests/wallet/send.rs @@ -8,8 +8,7 @@ use { fn inscriptions_can_be_sent() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -56,8 +55,7 @@ fn inscriptions_can_be_sent() { fn send_unknown_inscription() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -77,8 +75,7 @@ fn send_unknown_inscription() { fn send_inscribed_sat() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -111,8 +108,7 @@ fn send_inscribed_sat() { fn send_on_mainnnet_works_with_wallet_named_foo() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); let txid = bitcoin_rpc_server.mine_blocks(1)[0].txdata[0].txid(); @@ -133,8 +129,7 @@ fn send_on_mainnnet_works_with_wallet_named_foo() { fn send_addresses_must_be_valid_for_network() { let bitcoin_rpc_server = test_bitcoincore_rpc::builder().build(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -156,8 +151,7 @@ fn send_addresses_must_be_valid_for_network() { fn send_on_mainnnet_works_with_wallet_named_ord() { let bitcoin_rpc_server = test_bitcoincore_rpc::builder().build(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -177,8 +171,7 @@ fn send_on_mainnnet_works_with_wallet_named_ord() { fn send_does_not_use_inscribed_sats_as_cardinal_utxos() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -206,8 +199,7 @@ fn send_does_not_use_inscribed_sats_as_cardinal_utxos() { fn do_not_send_within_dust_limit_of_an_inscription() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -236,8 +228,7 @@ fn do_not_send_within_dust_limit_of_an_inscription() { fn can_send_after_dust_limit_from_an_inscription() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -262,11 +253,8 @@ fn can_send_after_dust_limit_from_an_inscription() { fn splitting_merged_inscriptions_is_possible() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-sats"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-sats"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -373,8 +361,7 @@ fn splitting_merged_inscriptions_is_possible() { fn inscriptions_cannot_be_sent_by_satpoint() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -396,8 +383,7 @@ fn inscriptions_cannot_be_sent_by_satpoint() { fn send_btc_with_fee_rate() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -443,8 +429,7 @@ fn send_btc_with_fee_rate() { fn send_btc_locks_inscriptions() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -479,8 +464,7 @@ fn send_btc_fails_if_lock_unspent_fails() { .fail_lock_unspent(true) .build(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -498,8 +482,7 @@ fn send_btc_fails_if_lock_unspent_fails() { fn wallet_send_with_fee_rate() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -535,8 +518,7 @@ fn wallet_send_with_fee_rate() { fn user_must_provide_fee_rate_to_send() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -561,8 +543,7 @@ fn user_must_provide_fee_rate_to_send() { fn wallet_send_with_fee_rate_and_target_postage() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -599,8 +580,7 @@ fn wallet_send_with_fee_rate_and_target_postage() { fn send_btc_does_not_send_locked_utxos() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -623,11 +603,8 @@ fn sending_rune_that_has_not_been_etched_is_an_error() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-runes", "--regtest"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-runes", "--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -650,11 +627,8 @@ fn sending_rune_with_excessive_precision_is_an_error() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-runes", "--regtest"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-runes", "--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -677,11 +651,8 @@ fn sending_rune_with_insufficient_balance_is_an_error() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-runes", "--regtest"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-runes", "--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -704,11 +675,8 @@ fn sending_rune_works() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-runes", "--regtest"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-runes", "--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -756,11 +724,8 @@ fn sending_spaced_rune_works() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-runes", "--regtest"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-runes", "--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -807,11 +772,8 @@ fn sending_rune_with_divisibility_works() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-runes", "--regtest"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-runes", "--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -882,11 +844,8 @@ fn sending_rune_leaves_unspent_runes_in_wallet() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-runes", "--regtest"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-runes", "--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -954,11 +913,8 @@ fn sending_rune_creates_transaction_with_expected_runestone() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-runes", "--regtest"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-runes", "--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1037,11 +993,8 @@ fn error_messages_use_spaced_runes() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-runes", "--regtest"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-runes", "--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -1070,11 +1023,8 @@ fn sending_rune_does_not_send_inscription() { .network(Network::Regtest) .build(); - let ord_rpc_server = TestServer::spawn_with_server_args( - &bitcoin_rpc_server, - &["--index-runes", "--regtest"], - &["--enable-json-api"], - ); + let ord_rpc_server = + TestServer::spawn_with_server_args(&bitcoin_rpc_server, &["--index-runes", "--regtest"], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); diff --git a/tests/wallet/transactions.rs b/tests/wallet/transactions.rs index 61eb85ac19..259d3c7356 100644 --- a/tests/wallet/transactions.rs +++ b/tests/wallet/transactions.rs @@ -3,8 +3,7 @@ use {super::*, ord::subcommand::wallet::transactions::Output}; #[test] fn transactions() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server); @@ -30,8 +29,7 @@ fn transactions() { #[test] fn transactions_with_limit() { let bitcoin_rpc_server = test_bitcoincore_rpc::spawn(); - let ord_rpc_server = - TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &["--enable-json-api"]); + let ord_rpc_server = TestServer::spawn_with_server_args(&bitcoin_rpc_server, &[], &[]); create_wallet(&bitcoin_rpc_server, &ord_rpc_server);