fn clock_updates() {
let test_server = TestServer::new();
test_server.assert_response_regex("/clock", StatusCode::OK, ".*<text.*>0</text>.*");
test_server.mine_blocks(1);
test_server.assert_response_regex("/clock", StatusCode::OK, ".*<text.*>1</text>.*");
}
#[test]
fn block_by_hash() {
let test_server = TestServer::new();
test_server.mine_blocks(1);
let transaction = TransactionTemplate {
inputs: &[(1, 0, 0, Default::default())],
fee: 0,
..Default::default()
};
test_server.bitcoin_rpc_server.broadcast_tx(transaction);
let block_hash = test_server.mine_blocks(1)[0].block_hash();
test_server.assert_response_regex(
format!("/block/{block_hash}"),
StatusCode::OK,
".*<h1>Block 2</h1>.*",
);
}
#[test]
fn block_by_height() {
let test_server = TestServer::new();
test_server.assert_response_regex("/block/0", StatusCode::OK, ".*<h1>Block 0</h1>.*");
}
#[test]
fn transaction() {
let test_server = TestServer::new();