server.mine_blocks(1);
server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate {
inputs: &[(1, 0, 0, inscription("text/foo", "hello").to_witness())],
..Default::default()
});
server.mine_blocks(1);
server.assert_response_regex(
"/feed.xml",
StatusCode::OK,
".*
Inscription 0.*",
);
}
#[test]
fn inscription_with_unknown_type_and_no_body_has_unknown_preview() {
let server = TestServer::new_with_regtest_with_index_sats();
server.mine_blocks(1);
let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate {
inputs: &[(
1,
0,
0,
Inscription::new(Some("foo/bar".as_bytes().to_vec()), None).to_witness(),
)],
..Default::default()
});
let inscription_id = InscriptionId { txid, index: 0 };
server.mine_blocks(1);
server.assert_response(
format!("/preview/{inscription_id}"),
StatusCode::OK,
&fs::read_to_string("templates/preview-unknown.html").unwrap(),