// Imports that need to be added manually
use lightning_rapid_gossip_sync::RapidGossipSync;
use utils::test_logger;

/// Actual fuzz test, method signature and name are fixed
fn do_test(data: &[u8]) {
	let block_hash = bitcoin::BlockHash::default();
	let network_graph = lightning::routing::gossip::NetworkGraph::new(block_hash);
	let rapid_sync = RapidGossipSync::new(&network_graph);
	let _ = rapid_sync.update_network_graph(data);
}

/// Method that needs to be added manually, {name}_test
pub fn process_network_graph_test<Out: test_logger::Output>(data: &[u8], _out: Out) {
	do_test(data);
}

/// Method that needs to be added manually, {name}_run
#[no_mangle]
pub extern "C" fn process_network_graph_run(data: *const u8, datalen: usize) {
	do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
}
