@@ -32,6 +32,7 @@ use libsigner::v0::messages::{
32
32
use libsigner:: v0:: signer_state:: MinerState ;
33
33
use libsigner:: { BlockProposal , SignerEntries , SignerEventTrait } ;
34
34
use serde:: { Deserialize , Serialize } ;
35
+ use stacks:: burnchains:: Txid ;
35
36
use stacks:: chainstate:: coordinator:: comm:: CoordinatorChannels ;
36
37
use stacks:: chainstate:: nakamoto:: signer_set:: NakamotoSigners ;
37
38
use stacks:: chainstate:: nakamoto:: NakamotoBlock ;
@@ -192,6 +193,9 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
192
193
let ( mut naka_conf, _miner_account) =
193
194
naka_neon_integration_conf ( snapshot_name. map ( |n| n. as_bytes ( ) ) ) ;
194
195
196
+ naka_conf. miner . activated_vrf_key_path =
197
+ Some ( format ! ( "{}/vrf_key" , naka_conf. node. working_dir) ) ;
198
+
195
199
node_config_modifier ( & mut naka_conf) ;
196
200
197
201
// Add initial balances to the config
@@ -1023,6 +1027,20 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
1023
1027
} )
1024
1028
}
1025
1029
1030
+ pub fn wait_for_replay_set_eq ( & self , timeout : u64 , expected_txids : Vec < String > ) {
1031
+ self . wait_for_signer_state_check ( timeout, |state| {
1032
+ let Some ( replay_set) = state. get_tx_replay_set ( ) else {
1033
+ return Ok ( false ) ;
1034
+ } ;
1035
+ let txids = replay_set
1036
+ . iter ( )
1037
+ . map ( |tx| tx. txid ( ) . to_hex ( ) )
1038
+ . collect :: < Vec < _ > > ( ) ;
1039
+ Ok ( txids == expected_txids)
1040
+ } )
1041
+ . expect ( "Timed out waiting for replay set to be equal to expected txids" ) ;
1042
+ }
1043
+
1026
1044
/// Replace the test's configured signer st
1027
1045
pub fn replace_signers (
1028
1046
& mut self ,
@@ -1509,6 +1527,31 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
1509
1527
. send_message_with_retry :: < SignerMessage > ( accepted. into ( ) )
1510
1528
. expect ( "Failed to send accept signature" ) ;
1511
1529
}
1530
+
1531
+ /// Get the txid of the parent block commit transaction for the given miner
1532
+ pub fn get_parent_block_commit_txid ( & self , miner_pk : & StacksPublicKey ) -> Option < Txid > {
1533
+ let Some ( confirmed_utxo) = self
1534
+ . running_nodes
1535
+ . btc_regtest_controller
1536
+ . get_all_utxos ( & miner_pk)
1537
+ . into_iter ( )
1538
+ . find ( |utxo| utxo. confirmations == 0 )
1539
+ else {
1540
+ return None ;
1541
+ } ;
1542
+ let unconfirmed_txid = Txid :: from_bitcoin_tx_hash ( & confirmed_utxo. txid ) ;
1543
+ let unconfirmed_tx = self
1544
+ . running_nodes
1545
+ . btc_regtest_controller
1546
+ . get_raw_transaction ( & unconfirmed_txid) ;
1547
+ let parent_txid = unconfirmed_tx
1548
+ . input
1549
+ . get ( 0 )
1550
+ . expect ( "First input should exist" )
1551
+ . previous_output
1552
+ . txid ;
1553
+ Some ( Txid :: from_bitcoin_tx_hash ( & parent_txid) )
1554
+ }
1512
1555
}
1513
1556
1514
1557
fn setup_stx_btc_node < G : FnMut ( & mut NeonConfig ) > (
0 commit comments