"/sat/0",
StatusCode::OK,
".*<title>Sat 0</title>.*<h1>Sat 0</h1>.*",
);
}
#[test]
fn block() {
TestServer::new().assert_response_regex(
"/block/0",
StatusCode::OK,
".*<title>Block 0</title>.*<h1>Block 0</h1>.*",
);
}
#[test]
fn sat_out_of_range() {
TestServer::new().assert_response(
"/sat/2099999997690000",
StatusCode::BAD_REQUEST,
"Invalid URL: invalid sat",
);
}
#[test]
fn invalid_outpoint_hash_returns_400() {
TestServer::new().assert_response(
"/output/foo:0",
StatusCode::BAD_REQUEST,
"Invalid URL: error parsing TXID",
);
}
#[test]
fn output_with_sat_index() {
let txid = "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b";
TestServer::new_with_sat_index().assert_response_regex(
format!("/output/{txid}:0"),
StatusCode::OK,
format!(
".*<title>Output {txid}:0</title>.*<h1>Output <span class=monospace>{txid}:0</span></h1>
<dl>
<dt>value</dt><dd>5000000000</dd>