transfer100.pizza#71,220,465brc-20mint100.void#67,582,768brc-20deploy.filer#66,805,456brc-20#66,763,386Inscription #66763385#66,763,385webpInscription #65967414#65,967,414pngInscription #65679301#65,679,301svgInscription #65039440#65,039,440svgInscription #50300731#50,300,731pngInscription #50300730#50,300,730pngInscription #50300706#50,300,706pngInscription #50296121#50,296,121pngInscription #50296119#50,296,119pngInscription #49563164#49,563,164pngInscription #49563162#49,563,162pngInscription #49563157#49,563,157pngInscription #49563151#49,563,151pngInscription #49563150#49,563,150pngit's all about the culture. this is new art. you are now minting the concept of a concept.#47,428,351textInscription #45319069#45,319,069pngInscription #45318854#45,318,854pngInscription #45317392#45,317,392pngInscription #45317312#45,317,312pngInscription #45317298#45,317,298png assert_eq!(response.status(), StatusCode::OK); assert_eq!( response.headers().get("content-type").unwrap(), "application/json" ); assert_eq!( response.text().unwrap(), format!("\"{}\"", hex::encode(encoded_metadata)) ); } #[test] fn inscriptions_page() { let rpc_server = test_bitcoincore_rpc::spawn(); create_wallet(&rpc_server); let (inscription, _) = inscribe(&rpc_server); TestServer::spawn_with_args(&rpc_server, &[]).assert_response_regex( "/inscriptions", format!( ".*<h1>All Inscriptions</h1> <div class=thumbnails> <a href=/inscription/{inscription}>.*</a> </div> .*", ), ); } #[test] fn inscriptions_page_is_sorted() { let rpc_server = test_bitcoincore_rpc::spawn(); create_wallet(&rpc_server); let mut regex = String::new(); for _ in 0..8 { let (inscription, _) = inscribe(&rpc_server); regex.insert_str(0, &format!(".*<a href=/inscription/{inscription}>.*")); } TestServer::spawn_with_args(&rpc_server, &[]).assert_response_regex("/inscriptions", &regex); #44,997,318text } pub(crate) fn request(&self, path: impl AsRef<str>) -> Response { self.sync_server(); reqwest::blocking::get(self.url().join(path.as_ref()).unwrap()).unwrap() } pub(crate) fn json_request(&self, path: impl AsRef<str>) -> Response { self.sync_server(); let client = reqwest::blocking::Client::new(); client .get(self.url().join(path.as_ref()).unwrap()) .header(reqwest::header::ACCEPT, "application/json") .send() .unwrap() } pub(crate) fn sync_server(&self) { let client = Client::new(&self.rpc_url, Auth::None).unwrap(); let chain_block_count = client.get_block_count().unwrap() + 1; for i in 0.. { let response = reqwest::blocking::get(self.url().join("/blockcount").unwrap()).unwrap(); assert_eq!(response.status(), StatusCode::OK); if response.text().unwrap().parse::<u64>().unwrap() == chain_block_count { break; } else if i == 20 { panic!("index failed to synchronize with chain"); } thread::sleep(Duration::from_millis(25)); #44,997,310textuse {super::*, std::ops::Deref}; #[test] fn inscribe_creates_inscriptions() { let rpc_server = test_bitcoincore_rpc::spawn(); rpc_server.mine_blocks(1); assert_eq!(rpc_server.descriptors().len(), 0); create_wallet(&rpc_server); let (inscription, _) = inscribe(&rpc_server); assert_eq!(rpc_server.descriptors().len(), 3); let request = TestServer::spawn_with_args(&rpc_server, &[]).request(format!("/content/{inscription}")); assert_eq!(request.status(), 200); assert_eq!( request.headers().get("content-type").unwrap(), "text/plain;charset=utf-8" ); assert_eq!(request.text().unwrap(), "FOO"); } #[test] fn inscribe_works_with_huge_expensive_inscriptions() { let rpc_server = test_bitcoincore_rpc::spawn(); create_wallet(&rpc_server); let txid = rpc_server.mine_blocks(1)[0].txdata[0].txid(); CommandBuilder::new(format!( "wallet inscribe --file foo.txt --satpoint {txid}:0:0 --fee-rate 10" )) .write("foo.txt", [0; 350_000]) .rpc_server(&rpc_server) .run_and_deserialize_output::<Inscribe>(); #44,997,058text "index_path": ".*\.redb", "leaf_pages": \d+, "metadata_bytes": \d+, "outputs_traversed": 0, "page_size": \d+, "sat_ranges": 0, "stored_bytes": \d+, "tables": .*, "transactions": \[ \{ "starting_block_count": 0, "starting_timestamp": \d+ \} \], "tree_height": \d+, "utxos_indexed": 0 \} "#, ) .run_and_extract_stdout(); } #[test] fn transactions() { let rpc_server = test_bitcoincore_rpc::spawn(); let tempdir = TempDir::new().unwrap(); let index_path = tempdir.path().join("index.redb"); assert!(CommandBuilder::new(format!( "--index {} index info --transactions", index_path.display() )) .rpc_server(&rpc_server) .run_and_deserialize_output::<Vec<TransactionsOutput>>() .is_empty()); rpc_server.mine_blocks(10); let output = CommandBuilder::new(format!( "--index {} index info --transactions", index_path.display() )) .rpc_server(&rpc_server) .run_and_deserialize_output::<Vec<TransactionsOutput>>(); assert_eq!(output[0].start, 0); #44,996,955textuse {super::*, ord::subcommand::wallet::balance::Output}; #[test] fn wallet_balance() { let rpc_server = test_bitcoincore_rpc::spawn(); create_wallet(&rpc_server); assert_eq!( CommandBuilder::new("wallet balance") .rpc_server(&rpc_server) .run_and_deserialize_output::<Output>() .cardinal, 0 ); rpc_server.mine_blocks(1); assert_eq!( CommandBuilder::new("wallet balance") .rpc_server(&rpc_server) .run_and_deserialize_output::<Output>() .cardinal, 50 * COIN_VALUE ); } #[test] fn wallet_balance_only_counts_cardinal_utxos() { let rpc_server = test_bitcoincore_rpc::spawn(); create_wallet(&rpc_server); assert_eq!( CommandBuilder::new("wallet balance") .rpc_server(&rpc_server) .run_and_deserialize_output::<Output>() .cardinal, 0 ); inscribe(&rpc_server); assert_eq!( CommandBuilder::new("wallet balance") .rpc_server(&rpc_server) .run_and_deserialize_output::<Output>() .cardinal, 100 * COIN_VALUE - 10_000 #44,996,954textInscription #41649213#41,649,213pngInscription #41649210#41,649,210pngInscription #41649208#41,649,208pngInscription #41649207#41,649,207pngInscription #41649204#41,649,204pngInscription #41649203#41,649,203pngInscription #41649196#41,649,196pngInscription #41649104#41,649,104pngInscription #41649091#41,649,091pngInscription #41649058#41,649,058pngtransfer200,000.reko#41,222,805brc-20transfer5,000,000,000.sats#39,401,206brc-20Inscription #38991689#38,991,689pngtransfer833,333.cats#37,199,375brc-20mint1,000,000,000.leek#36,894,416brc-20mint1,000,000,000.leek#36,894,415brc-20mint1,000,000,000.leek#36,894,414brc-20mint1,000,000,000.leek#36,894,413brc-20mint1,000,000,000.leek#36,894,412brc-20mint1,000,000,000.leek#36,894,411brc-20mint1,000,000,000.leek#36,894,410brc-20mint1,000,000,000.leek#36,894,409brc-20mint1,000,000,000.leek#36,894,408brc-20mint1,000,000,000.leek#36,894,407brc-20mint1,000,000,000.leek#36,894,406brc-20mint1,000,000,000.leek#36,894,405brc-20mint1,000,000,000.leek#36,894,404brc-20mint1,000,000,000.leek#36,894,403brc-20mint1,000,000,000.leek#36,894,402brc-20mint1,000,000,000.leek#36,894,401brc-20mint1,000,000,000.leek#36,894,400brc-20