@@ -171,6 +171,7 @@ pub async fn async_create_evaluating_project<
171
171
let mut inst = instantiator. lock ( ) . await ;
172
172
173
173
inst. start_evaluation ( project_id, issuer) . unwrap ( ) ;
174
+ let now = inst. current_block ( ) ;
174
175
project_id
175
176
}
176
177
@@ -191,7 +192,7 @@ pub async fn async_start_auction<
191
192
if project_details. status == ProjectStatus :: EvaluationRound {
192
193
let update_block = inst. get_update_block ( project_id, & UpdateType :: EvaluationEnd ) . unwrap ( ) ;
193
194
let notify = Arc :: new ( Notify :: new ( ) ) ;
194
- block_orchestrator. add_awaiting_project ( update_block + 1u32 . into ( ) , notify. clone ( ) ) . await ;
195
+ block_orchestrator. add_awaiting_project ( update_block, notify. clone ( ) ) . await ;
195
196
196
197
// Wait for the notification that our desired block was reached to continue
197
198
drop ( inst) ;
@@ -282,7 +283,7 @@ pub async fn async_start_community_funding<
282
283
let mut inst = instantiator. lock ( ) . await ;
283
284
284
285
let update_block = inst. get_update_block ( project_id, & UpdateType :: AuctionClosingStart ) . unwrap ( ) ;
285
- let closing_start = update_block + 1u32 . into ( ) ;
286
+ let closing_start = update_block;
286
287
287
288
let notify = Arc :: new ( Notify :: new ( ) ) ;
288
289
@@ -296,7 +297,7 @@ pub async fn async_start_community_funding<
296
297
297
298
inst = instantiator. lock ( ) . await ;
298
299
let update_block = inst. get_update_block ( project_id, & UpdateType :: CommunityFundingStart ) . unwrap ( ) ;
299
- let community_start = update_block + 1u32 . into ( ) ;
300
+ let community_start = update_block;
300
301
301
302
let notify = Arc :: new ( Notify :: new ( ) ) ;
302
303
@@ -433,7 +434,7 @@ pub async fn async_start_remainder_or_end_funding<
433
434
assert_eq ! ( inst. get_project_details( project_id) . status, ProjectStatus :: CommunityRound ) ;
434
435
435
436
let update_block = inst. get_update_block ( project_id, & UpdateType :: RemainderFundingStart ) . unwrap ( ) ;
436
- let remainder_start = update_block + 1u32 . into ( ) ;
437
+ let remainder_start = update_block;
437
438
438
439
let notify = Arc :: new ( Notify :: new ( ) ) ;
439
440
@@ -550,7 +551,9 @@ pub async fn async_finish_funding<
550
551
let update_block = inst. get_update_block ( project_id, & UpdateType :: FundingEnd ) . unwrap ( ) ;
551
552
552
553
let notify = Arc :: new ( Notify :: new ( ) ) ;
553
- block_orchestrator. add_awaiting_project ( update_block + 1u32 . into ( ) , notify. clone ( ) ) . await ;
554
+ block_orchestrator. add_awaiting_project ( update_block, notify. clone ( ) ) . await ;
555
+ drop ( inst) ;
556
+ notify. notified ( ) . await ;
554
557
Ok ( ( ) )
555
558
}
556
559
@@ -768,7 +771,9 @@ pub async fn async_create_project_at<
768
771
let time_to_community: BlockNumberFor < T > =
769
772
time_to_auction + <T as Config >:: AuctionOpeningDuration :: get ( ) + <T as Config >:: AuctionClosingDuration :: get ( ) ;
770
773
let time_to_remainder: BlockNumberFor < T > = time_to_community + <T as Config >:: CommunityFundingDuration :: get ( ) ;
771
- let time_to_finish: BlockNumberFor < T > = time_to_remainder + <T as Config >:: RemainderFundingDuration :: get ( ) ;
774
+ let time_to_finish: BlockNumberFor < T > = time_to_remainder +
775
+ <T as Config >:: RemainderFundingDuration :: get ( ) +
776
+ <T as Config >:: SuccessToSettlementTime :: get ( ) ;
772
777
let mut inst = mutex_inst. lock ( ) . await ;
773
778
let now = inst. current_block ( ) ;
774
779
drop ( inst) ;
@@ -786,6 +791,7 @@ pub async fn async_create_project_at<
786
791
block_orchestrator. add_awaiting_project ( now + time_to_finish - time_to_evaluation, notify. clone ( ) ) . await ;
787
792
// Wait for the notification that our desired block was reached to continue
788
793
notify. notified ( ) . await ;
794
+ let now = mutex_inst. lock ( ) . await . current_block ( ) ;
789
795
async_create_evaluating_project (
790
796
mutex_inst. clone ( ) ,
791
797
test_project_params. metadata ,
0 commit comments