@@ -117,14 +117,37 @@ pub async fn syncing<
117117
118118 #[ cfg( feature = "testing" ) ]
119119 {
120+ use std:: collections:: BTreeMap ;
121+
122+ use futures:: StreamExt ;
123+ use namada_core:: masp:: MaspEpoch ;
124+
120125 // Load the confirmed context (if present) and update the conversions
121126 // for the shielded history. This is needed for integration
122127 // tests only as the cli wallet is not supposed to compile the
123128 // history of shielded transactions
124129 shielded. load_confirmed ( ) . await ;
125- let masp_epoch = namada_sdk:: rpc:: query_masp_epoch ( & client) . await ?;
126- for ( asset_type, ( token, denom, position, epoch, _conv) ) in
127- namada_sdk:: rpc:: query_conversions ( & client, & masp_epoch) . await ?
130+ let current_masp_epoch =
131+ namada_sdk:: rpc:: query_masp_epoch ( & client) . await ?;
132+ let epochs: Vec < _ > = MaspEpoch :: iter_bounds_inclusive (
133+ MaspEpoch :: zero ( ) ,
134+ current_masp_epoch,
135+ )
136+ . collect ( ) ;
137+ let conversion_tasks = epochs
138+ . iter ( )
139+ . map ( |epoch| namada_sdk:: rpc:: query_conversions ( & client, epoch) ) ;
140+ let conversions = futures:: stream:: iter ( conversion_tasks)
141+ . buffer_unordered ( 100 )
142+ . fold ( BTreeMap :: default ( ) , async |mut acc, conversion| {
143+ acc. append (
144+ & mut conversion. expect ( "Conversion should be defined" ) ,
145+ ) ;
146+ acc
147+ } )
148+ . await ;
149+
150+ for ( asset_type, ( token, denom, position, epoch, _conv) ) in conversions
128151 {
129152 let pre_asset_type = AssetData {
130153 token,
0 commit comments