Skip to content

Commit 455b918

Browse files
committed
f Address test TODO
1 parent 9eb311c commit 455b918

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/tests/functional_tests.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ fn channel_full_cycle() {
137137
premine_and_distribute_funds(vec![addr_a, addr_b], Amount::from_sat(100000));
138138
node_a.sync_wallets().unwrap();
139139
node_b.sync_wallets().unwrap();
140-
assert_eq!(node_a.on_chain_balance().unwrap().confirmed, 100000);
141-
assert_eq!(node_b.on_chain_balance().unwrap().confirmed, 100000);
140+
assert_eq!(node_a.on_chain_balance().unwrap().get_spendable(), 100000);
141+
assert_eq!(node_b.on_chain_balance().unwrap().get_spendable(), 100000);
142142

143143
println!("\nA -- connect_open_channel -> B");
144144
let node_b_addr =
@@ -154,9 +154,9 @@ fn channel_full_cycle() {
154154
node_b.sync_wallets().unwrap();
155155

156156
let node_a_balance = node_a.on_chain_balance().unwrap();
157-
assert!(node_a_balance.confirmed < 50000);
158-
assert!(node_a_balance.confirmed > 40000);
159-
assert_eq!(node_b.on_chain_balance().unwrap().confirmed, 100000);
157+
assert!(node_a_balance.get_spendable() < 50000);
158+
assert!(node_a_balance.get_spendable() > 40000);
159+
assert_eq!(node_b.on_chain_balance().unwrap().get_spendable(), 100000);
160160

161161
expect_event!(node_a, ChannelReady);
162162

@@ -186,12 +186,9 @@ fn channel_full_cycle() {
186186
expect_event!(node_a, ChannelClosed);
187187
expect_event!(node_b, ChannelClosed);
188188

189-
// TODO: Not entirely sure why we need *another* confirmation before the funds show up as
190-
// confirmed. Is this expected or a BDK bug?
191-
generate_blocks_and_wait(1);
192189
node_a.sync_wallets().unwrap();
193-
assert!(node_a.on_chain_balance().unwrap().confirmed > 90000);
194-
assert_eq!(node_b.on_chain_balance().unwrap().confirmed, 100000);
190+
assert!(node_a.on_chain_balance().unwrap().get_spendable() > 90000);
191+
assert_eq!(node_b.on_chain_balance().unwrap().get_spendable(), 100000);
195192

196193
node_a.stop().unwrap();
197194
println!("\nA stopped");

0 commit comments

Comments
 (0)