@@ -91,7 +91,6 @@ use bytes::Bytes;
9191use delete_set:: { BaoFilePart , ProtectHandle } ;
9292use entity_manager:: { EntityManagerState , SpawnArg } ;
9393use entry_state:: { DataLocation , OutboardLocation } ;
94- use gc:: run_gc;
9594use import:: { ImportEntry , ImportSource } ;
9695use irpc:: { channel:: mpsc, RpcMessage } ;
9796use meta:: list_blobs;
@@ -120,6 +119,7 @@ use crate::{
120119 } ,
121120 util:: entity_manager:: { self , ActiveEntityState } ,
122121 } ,
122+ gc:: run_gc,
123123 util:: { BaoTreeSender , FixedSize , MemOrFile , ValueOrPoisioned } ,
124124 IROH_BLOCK_SIZE ,
125125 } ,
@@ -141,7 +141,6 @@ use entry_state::EntryState;
141141use import:: { import_byte_stream, import_bytes, import_path, ImportEntryMsg } ;
142142use options:: Options ;
143143use tracing:: Instrument ;
144- mod gc;
145144
146145use crate :: {
147146 api:: {
@@ -1498,10 +1497,7 @@ pub mod tests {
14981497 use core:: panic;
14991498 use std:: collections:: { HashMap , HashSet } ;
15001499
1501- use bao_tree:: {
1502- io:: { outboard:: PreOrderMemOutboard , round_up_to_chunks_groups} ,
1503- ChunkRanges ,
1504- } ;
1500+ use bao_tree:: { io:: round_up_to_chunks_groups, ChunkRanges } ;
15051501 use n0_future:: { stream, Stream , StreamExt } ;
15061502 use testresult:: TestResult ;
15071503 use walkdir:: WalkDir ;
@@ -1510,7 +1506,7 @@ pub mod tests {
15101506 use crate :: {
15111507 api:: blobs:: Bitfield ,
15121508 store:: {
1513- util:: { read_checksummed, SliceInfoExt , Tag } ,
1509+ util:: { read_checksummed, tests :: create_n0_bao , SliceInfoExt , Tag } ,
15141510 IROH_BLOCK_SIZE ,
15151511 } ,
15161512 } ;
@@ -1527,17 +1523,6 @@ pub mod tests {
15271523 1024 * 1024 * 8 , // data file, outboard file
15281524 ] ;
15291525
1530- /// Create n0 flavoured bao. Note that this can be used to request ranges below a chunk group size,
1531- /// which can not be exported via bao because we don't store hashes below the chunk group level.
1532- pub fn create_n0_bao ( data : & [ u8 ] , ranges : & ChunkRanges ) -> anyhow:: Result < ( Hash , Vec < u8 > ) > {
1533- let outboard = PreOrderMemOutboard :: create ( data, IROH_BLOCK_SIZE ) ;
1534- let mut encoded = Vec :: new ( ) ;
1535- let size = data. len ( ) as u64 ;
1536- encoded. extend_from_slice ( & size. to_le_bytes ( ) ) ;
1537- bao_tree:: io:: sync:: encode_ranges_validated ( data, & outboard, ranges, & mut encoded) ?;
1538- Ok ( ( outboard. root . into ( ) , encoded) )
1539- }
1540-
15411526 pub fn round_up_request ( size : u64 , ranges : & ChunkRanges ) -> ChunkRanges {
15421527 let last_chunk = ChunkNum :: chunks ( size) ;
15431528 let data_range = ChunkRanges :: from ( ..last_chunk) ;
0 commit comments