Skip to content

Commit

Permalink
f tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Feb 16, 2024
1 parent ed66196 commit 38a01ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lightning/src/util/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ impl<'a> Router for TestRouter<'a> {
inflight_htlcs: InFlightHtlcs
) -> Result<Route, msgs::LightningError> {
let route_res;
if let Some((find_route_query, find_route_res)) = self.next_routes.lock().unwrap().pop_front() {
let next_route_opt = self.next_routes.lock().unwrap().pop_front();
if let Some((find_route_query, find_route_res)) = next_route_opt {
assert_eq!(find_route_query, *params);
if let Ok(ref route) = find_route_res {
assert_eq!(route.route_params, Some(find_route_query));
Expand Down Expand Up @@ -209,7 +210,7 @@ impl<'a> Router for TestRouter<'a> {

if let Ok(route) = &route_res {
// Previously, `Route`s failed to round-trip through serialization due to a write/read
// mismatch. Thus, hwere we test all test-generated routes round-trip:
// mismatch. Thus, here we test all test-generated routes round-trip:
let ser = route.encode();
assert_eq!(Route::read(&mut &ser[..]).unwrap(), *route);
}
Expand Down

0 comments on commit 38a01ed

Please sign in to comment.