@@ -59,7 +59,7 @@ use crate::tests::bitcoin_regtest::BitcoinCoreController;
59
59
use crate :: tests:: nakamoto_integrations:: {
60
60
boot_to_epoch_3_reward_set, boot_to_epoch_3_reward_set_calculation_boundary,
61
61
naka_neon_integration_conf, next_block_and, next_block_and_mine_commit,
62
- POX_4_DEFAULT_STACKER_BALANCE ,
62
+ next_block_and_process_new_stacks_block , POX_4_DEFAULT_STACKER_BALANCE ,
63
63
} ;
64
64
use crate :: tests:: neon_integrations:: {
65
65
next_block_and_wait, run_until_burnchain_height, test_observer, wait_for_runloop,
@@ -1162,44 +1162,33 @@ fn stackerdb_delayed_dkg() {
1162
1162
) ;
1163
1163
1164
1164
info ! ( "------------------------- Start DKG -------------------------" ) ;
1165
- let height = signer_test
1166
- . running_nodes
1167
- . btc_regtest_controller
1168
- . get_headers_height ( ) ;
1165
+ info ! ( "Waiting for DKG to start..." ) ;
1169
1166
// Advance one more to trigger DKG
1170
- run_until_burnchain_height (
1167
+ next_block_and (
1171
1168
& mut signer_test. running_nodes . btc_regtest_controller ,
1172
- & signer_test . running_nodes . blocks_processed ,
1173
- height . wrapping_add ( 1 ) ,
1174
- & signer_test . running_nodes . conf ,
1175
- ) ;
1169
+ timeout . as_secs ( ) ,
1170
+ || Ok ( true ) ,
1171
+ )
1172
+ . expect ( "Failed to mine bitcoin block" ) ;
1176
1173
// Wait a bit so DKG is actually triggered and signers are not available to respond
1177
1174
std:: thread:: sleep ( Duration :: from_secs ( 5 ) ) ;
1178
1175
1179
- // Make sure DKG did not get set
1180
- assert ! ( signer_test
1181
- . stacks_client
1182
- . get_approved_aggregate_key( reward_cycle)
1183
- . expect( "Failed to get approved aggregate key" )
1184
- . is_none( ) ) ;
1185
-
1186
1176
info ! ( "------------------------- Restart Stopped Signer -------------------------" ) ;
1187
1177
1188
1178
signer_test. restart_signer ( signer_idx, signer_key) ;
1189
1179
1190
1180
info ! ( "------------------------- Wait for DKG -------------------------" ) ;
1191
1181
let key = signer_test. wait_for_dkg ( timeout) ;
1192
- let height = signer_test
1193
- . running_nodes
1194
- . btc_regtest_controller
1195
- . get_headers_height ( ) ;
1196
- // Advance one more to mine dkg transactions
1197
- run_until_burnchain_height (
1182
+ // Sleep a bit to make sure the transactions are broadcast.
1183
+ std:: thread:: sleep ( Duration :: from_secs ( 1 ) ) ;
1184
+ // Mine a block and make sure the votes were mined
1185
+ next_block_and_process_new_stacks_block (
1198
1186
& mut signer_test. running_nodes . btc_regtest_controller ,
1199
- & signer_test. running_nodes . blocks_processed ,
1200
- height. wrapping_add ( 1 ) ,
1201
- & signer_test. running_nodes . conf ,
1202
- ) ;
1187
+ timeout. as_secs ( ) ,
1188
+ & signer_test. running_nodes . coord_channel ,
1189
+ )
1190
+ . unwrap ( ) ;
1191
+
1203
1192
// Make sure DKG did get set
1204
1193
assert_eq ! (
1205
1194
key,
0 commit comments