@@ -2877,25 +2877,6 @@ impl SortitionDB {
2877
2877
query_rows ( self . conn ( ) , qry, NO_PARAMS )
2878
2878
}
2879
2879
2880
- /// Load up all stacks chain tips, in ascending order by block height. Great for testing!
2881
- pub fn get_all_stacks_chain_tips (
2882
- & self ,
2883
- ) -> Result < Vec < ( SortitionId , ConsensusHash , BlockHeaderHash , u64 ) > , db_error > {
2884
- let sql = "SELECT * FROM stacks_chain_tips ORDER BY block_height ASC" ;
2885
- let mut stmt = self . conn ( ) . prepare ( sql) ?;
2886
- let mut qry = stmt. query ( NO_PARAMS ) ?;
2887
- let mut ret = vec ! [ ] ;
2888
- while let Some ( row) = qry. next ( ) ? {
2889
- let sort_id: SortitionId = row. get ( "sortition_id" ) ?;
2890
- let consensus_hash: ConsensusHash = row. get ( "consensus_hash" ) ?;
2891
- let block_hash: BlockHeaderHash = row. get ( "block_hash" ) ?;
2892
- let block_height_i64: i64 = row. get ( "block_height" ) ?;
2893
- let block_height = u64:: try_from ( block_height_i64) . map_err ( |_| db_error:: ParseError ) ?;
2894
- ret. push ( ( sort_id, consensus_hash, block_hash, block_height) ) ;
2895
- }
2896
- Ok ( ret)
2897
- }
2898
-
2899
2880
/// Get all snapshots for a burn block hash, even if they're not on the canonical PoX fork.
2900
2881
pub fn get_all_snapshots_for_burn_block (
2901
2882
conn : & DBConn ,
@@ -6633,6 +6614,26 @@ pub mod tests {
6633
6614
6634
6615
Ok ( None )
6635
6616
}
6617
+
6618
+ /// Load up all stacks chain tips, in ascending order by block height. Great for testing!
6619
+ pub fn get_all_stacks_chain_tips (
6620
+ & self ,
6621
+ ) -> Result < Vec < ( SortitionId , ConsensusHash , BlockHeaderHash , u64 ) > , db_error > {
6622
+ let sql = "SELECT * FROM stacks_chain_tips ORDER BY block_height ASC" ;
6623
+ let mut stmt = self . conn ( ) . prepare ( sql) ?;
6624
+ let mut qry = stmt. query ( NO_PARAMS ) ?;
6625
+ let mut ret = vec ! [ ] ;
6626
+ while let Some ( row) = qry. next ( ) ? {
6627
+ let sort_id: SortitionId = row. get ( "sortition_id" ) ?;
6628
+ let consensus_hash: ConsensusHash = row. get ( "consensus_hash" ) ?;
6629
+ let block_hash: BlockHeaderHash = row. get ( "block_hash" ) ?;
6630
+ let block_height_i64: i64 = row. get ( "block_height" ) ?;
6631
+ let block_height =
6632
+ u64:: try_from ( block_height_i64) . map_err ( |_| db_error:: ParseError ) ?;
6633
+ ret. push ( ( sort_id, consensus_hash, block_hash, block_height) ) ;
6634
+ }
6635
+ Ok ( ret)
6636
+ }
6636
6637
}
6637
6638
6638
6639
#[ test]
0 commit comments