Skip to content

Commit 4c6bf0b

Browse files
committed
f use Option<bool> in accountable tests
1 parent 509adbe commit 4c6bf0b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lightning/src/ln/accountable_tests.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ use crate::ln::channelmanager::{
22
HTLCForwardInfo, PaymentId, PendingAddHTLCInfo, PendingHTLCInfo, RecipientOnionFields, Retry,
33
};
44
use crate::ln::functional_test_utils::*;
5-
use crate::ln::msgs::{accountable_from_bool, ChannelMessageHandler, ExperimentalAccountable};
5+
use crate::ln::msgs::ChannelMessageHandler;
66
use crate::routing::router::{PaymentParameters, RouteParameters};
77

88
fn test_accountable_forwarding_with_override(
9-
override_accountable: ExperimentalAccountable, expected_forwarded: bool,
9+
override_accountable: Option<bool>, expected_forwarded: bool,
1010
) {
1111
let chanmon_cfgs = create_chanmon_cfgs(3);
1212
let node_cfgs = create_node_cfgs(3, &chanmon_cfgs);
@@ -32,7 +32,7 @@ fn test_accountable_forwarding_with_override(
3232
let updates_ab = get_htlc_update_msgs(&nodes[0], &nodes[1].node.get_our_node_id());
3333
assert_eq!(updates_ab.update_add_htlcs.len(), 1);
3434
let mut htlc_ab = updates_ab.update_add_htlcs[0].clone();
35-
assert_eq!(htlc_ab.accountable, accountable_from_bool(false));
35+
assert_eq!(htlc_ab.accountable, Some(false));
3636

3737
// Override accountable value if requested
3838
if let Some(override_value) = override_accountable {
@@ -47,11 +47,11 @@ fn test_accountable_forwarding_with_override(
4747
let updates_bc = get_htlc_update_msgs(&nodes[1], &nodes[2].node.get_our_node_id());
4848
assert_eq!(updates_bc.update_add_htlcs.len(), 1);
4949
let htlc_bc = &updates_bc.update_add_htlcs[0];
50-
let expected_acountable_signal = accountable_from_bool(expected_forwarded);
5150
assert_eq!(
52-
htlc_bc.accountable, expected_acountable_signal,
51+
htlc_bc.accountable,
52+
Some(expected_forwarded),
5353
"B -> C should have accountable = {:?}",
54-
expected_acountable_signal
54+
expected_forwarded
5555
);
5656

5757
nodes[2].node.handle_update_add_htlc(nodes[1].node.get_our_node_id(), htlc_bc);
@@ -86,6 +86,6 @@ fn test_accountable_forwarding_with_override(
8686
fn test_accountable_signal() {
8787
// Tests forwarding of accountable signal for various incoming signal values.
8888
test_accountable_forwarding_with_override(None, false);
89-
test_accountable_forwarding_with_override(Some(7), true);
90-
test_accountable_forwarding_with_override(Some(3), false);
89+
test_accountable_forwarding_with_override(Some(true), true);
90+
test_accountable_forwarding_with_override(Some(false), false);
9191
}

0 commit comments

Comments
 (0)