+// This file is Copyright its original authors, visible in version control
+// history.
+//
+// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
+// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
+// You may not use this file except in accordance with one or both of these
+// licenses.
+
//! Test that no series of bytes received over the wire/connections created/payments sent can
//! result in a crash. We do this by standing up a node and then reading bytes from input to denote
//! actions such as creating new inbound/outbound connections, bytes to be read from a connection,
input: Arc<InputData>,
}
impl FeeEstimator for FuzzEstimator {
- fn get_est_sat_per_1000_weight(&self, _: ConfirmationTarget) -> u64 {
+ fn get_est_sat_per_1000_weight(&self, _: ConfirmationTarget) -> u32 {
//TODO: We should actually be testing at least much more than 64k...
match self.input.get_slice(2) {
- Some(slice) => cmp::max(slice_to_be16(slice) as u64, 253),
+ Some(slice) => cmp::max(slice_to_be16(slice) as u32, 253),
None => 253
}
}
hash_map::Entry::Vacant(e) => {
e.insert(self.height);
txn.push(tx);
- txn_idxs.push(idx as u32 + 1);
+ txn_idxs.push(idx + 1);
},
_ => {},
}
},
4 => {
let value = slice_to_be24(get_slice!(3)) as u64;
- let route = match get_route(&our_id, &net_graph_msg_handler, &get_pubkey!(), None, &Vec::new(), value, 42, Arc::clone(&logger)) {
+ let route = match get_route(&our_id, &net_graph_msg_handler.network_graph.read().unwrap(), &get_pubkey!(), None, &Vec::new(), value, 42, Arc::clone(&logger)) {
Ok(route) => route,
Err(_) => return,
};
},
15 => {
let value = slice_to_be24(get_slice!(3)) as u64;
- let mut route = match get_route(&our_id, &net_graph_msg_handler, &get_pubkey!(), None, &Vec::new(), value, 42, Arc::clone(&logger)) {
+ let mut route = match get_route(&our_id, &net_graph_msg_handler.network_graph.read().unwrap(), &get_pubkey!(), None, &Vec::new(), value, 42, Arc::clone(&logger)) {
Ok(route) => route,
Err(_) => return,
};