@@ -137,8 +137,8 @@ fn channel_full_cycle() {
137
137
premine_and_distribute_funds ( vec ! [ addr_a, addr_b] , Amount :: from_sat ( 100000 ) ) ;
138
138
node_a. sync_wallets ( ) . unwrap ( ) ;
139
139
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 ) ;
142
142
143
143
println ! ( "\n A -- connect_open_channel -> B" ) ;
144
144
let node_b_addr =
@@ -154,9 +154,9 @@ fn channel_full_cycle() {
154
154
node_b. sync_wallets ( ) . unwrap ( ) ;
155
155
156
156
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 ) ;
160
160
161
161
expect_event ! ( node_a, ChannelReady ) ;
162
162
@@ -186,12 +186,9 @@ fn channel_full_cycle() {
186
186
expect_event ! ( node_a, ChannelClosed ) ;
187
187
expect_event ! ( node_b, ChannelClosed ) ;
188
188
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 ) ;
192
189
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 ) ;
195
192
196
193
node_a. stop ( ) . unwrap ( ) ;
197
194
println ! ( "\n A stopped" ) ;
0 commit comments