SHOWING: First 60
"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);
#45,040,982text"```"
msgstr ""
"```sh\n"
"bitcoin-cli getdescriptorinfo \\\n"
" "
"'wpkh([bf1dd55e/84h/0h/0h]xpub6CcJtWcvFQaMo39ANFi1MyXkEXM8T8ZhnxMtSjQAdPmVSTHYnc8Hwoc11VpuP8cb8JUTboZB5A7YYGDonYySij4XTawL6iNZvmZwdnSEEep/0/*)'\n"
"```"
#: src/guides/sat-hunting.md:170
msgid ""
"```json\n"
"{\n"
" \"descriptor\": "
"\"wpkh([bf1dd55e/84'/0'/0']xpub6CcJtWcvFQaMo39ANFi1MyXkEXM8T8ZhnxMtSjQAdPmVSTHYnc8Hwoc11VpuP8cb8JUTboZB5A7YYGDonYySij4XTawL6iNZvmZwdnSEEep/0/*)#csvefu29\",\n"
" \"checksum\": \"tpnxnxax\",\n"
" \"isrange\": true,\n"
" \"issolvable\": true,\n"
" \"hasprivatekeys\": false\n"
"}\n"
"```"
msgstr ""
"```json\n"
"{\n"
" \"descriptor\": "
"\"wpkh([bf1dd55e/84'/0'/0']xpub6CcJtWcvFQaMo39ANFi1MyXkEXM8T8ZhnxMtSjQAdPmVSTHYnc8Hwoc11VpuP8cb8JUTboZB5A7YYGDonYySij4XTawL6iNZvmZwdnSEEep/0/*)#csvefu29\",\n"
" \"checksum\": \"tpnxnxax\",\n"
" \"isrange\": true,\n"
" \"issolvable\": true,\n"
" \"hasprivatekeys\": false\n"
"}\n"
"```"
#: src/guides/sat-hunting.md:180
msgid "And for the change address descriptor, in this case `64k8wnd7`:"#44,995,169text }
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,990,676text create_wallet(&rpc_server);
rpc_server.mine_blocks(1);
let four_megger = std::iter::repeat(0).take(4_000_000).collect::<Vec<u8>>();
CommandBuilder::new("wallet inscribe --no-limit degenerate.png --fee-rate 1")
.write("degenerate.png", four_megger)
.rpc_server(&rpc_server);
}
#[test]
fn inscribe_works_with_postage() {
let rpc_server = test_bitcoincore_rpc::spawn();
create_wallet(&rpc_server);
rpc_server.mine_blocks(1);
CommandBuilder::new("wallet inscribe --file foo.txt --postage 5btc --fee-rate 10".to_string())
.write("foo.txt", [0; 350])
.rpc_server(&rpc_server)
.run_and_deserialize_output::<Inscribe>();
rpc_server.mine_blocks(1);
let inscriptions = CommandBuilder::new("wallet inscriptions".to_string())
.write("foo.txt", [0; 350])
.rpc_server(&rpc_server)
.run_and_deserialize_output::<Vec<ord::subcommand::wallet::inscriptions::Output>>();
pretty_assert_eq!(inscriptions[0].postage, 5 * COIN_VALUE);
}
#[test]
fn inscribe_with_non_existent_parent_inscription() {
#44,990,667text<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<link rel=stylesheet href=/static/preview-video.css>
</head>
<body>
<video controls loop muted autoplay>
<source src=/content/{{self.inscription_id}}>
</video>
</body>
</html>
#44,988,604textuse super::*;
#[derive(Boilerplate)]
pub(crate) struct TransactionHtml {
blockhash: Option<BlockHash>,
chain: Chain,
etching: Option<Rune>,
inscription: Option<InscriptionId>,
transaction: Transaction,
txid: Txid,
}
impl TransactionHtml {
pub(crate) fn new(
transaction: Transaction,
blockhash: Option<BlockHash>,
inscription: Option<InscriptionId>,
chain: Chain,
etching: Option<Rune>,
) -> Self {
Self {
txid: transaction.txid(),
blockhash,
chain,
etching,
inscription,
transaction,
}
}
}
impl PageContent for TransactionHtml {
fn title(&self) -> String {
format!("Transaction {}", self.txid)
}
}
#[cfg(test)]
mod tests {
use {
super::*,
bitcoin::{blockdata::script, locktime::absolute::LockTime, TxOut},
};
#[test]
fn html() {
let transaction = Transaction {
version: 0,
lock_time: LockTime::ZERO,
input: vec![TxIn {
sequence: Default::default(),
previous_output: Default::default(),
#44,987,223text