@@ -70,7 +70,7 @@ fn get_migrations_for_participants(
70
70
for participant in participants {
71
71
let ( status, migrations) =
72
72
pallet_funding:: UserMigrations :: < PolimecRuntime > :: get ( ( project_id, participant. clone ( ) ) ) . unwrap ( ) ;
73
- user_migrations. insert ( participant, ( status, Migrations :: from ( migrations. into ( ) ) ) ) ;
73
+ user_migrations. insert ( participant, ( status, Migrations :: from ( migrations. to_vec ( ) ) ) ) ;
74
74
}
75
75
} ) ;
76
76
user_migrations
@@ -159,8 +159,8 @@ fn create_settled_project() -> (ProjectId, Vec<AccountId>) {
159
159
let mut inst = IntegrationInstantiator :: new ( None ) ;
160
160
161
161
let project_metadata = default_project_metadata ( ISSUER . into ( ) ) ;
162
- let evaluations = inst. generate_successful_evaluations ( project_metadata. clone ( ) , 5 ) ;
163
- let bids = inst. generate_bids_from_total_ct_percent ( project_metadata. clone ( ) , 95 , 8 ) ;
162
+ let evaluations = inst. generate_successful_evaluations ( project_metadata. clone ( ) , 10 ) ;
163
+ let bids = inst. generate_bids_from_total_ct_percent ( project_metadata. clone ( ) , 95 , 30 ) ;
164
164
PolimecNet :: execute_with ( || {
165
165
let project_id = inst. create_finished_project ( project_metadata, ISSUER . into ( ) , None , evaluations, bids) ;
166
166
assert_eq ! (
@@ -170,11 +170,7 @@ fn create_settled_project() -> (ProjectId, Vec<AccountId>) {
170
170
let mut participants: Vec < AccountId > =
171
171
pallet_funding:: Evaluations :: < PolimecRuntime > :: iter_prefix_values ( ( project_id, ) )
172
172
. map ( |eval| eval. evaluator )
173
- . chain ( pallet_funding:: Bids :: < PolimecRuntime > :: iter_prefix_values ( ( project_id, ) ) . map ( |bid| bid. bidder ) )
174
- . chain (
175
- pallet_funding:: Contributions :: < PolimecRuntime > :: iter_prefix_values ( ( project_id, ) )
176
- . map ( |contribution| contribution. contributor ) ,
177
- )
173
+ . chain ( pallet_funding:: Bids :: < PolimecRuntime > :: iter_prefix_values ( project_id) . map ( |bid| bid. bidder ) )
178
174
. collect ( ) ;
179
175
participants. sort ( ) ;
180
176
participants. dedup ( ) ;
@@ -211,8 +207,8 @@ fn create_project_with_unsettled_participation(participation_type: Participation
211
207
let mut inst = IntegrationInstantiator :: new ( None ) ;
212
208
PolimecNet :: execute_with ( || {
213
209
let project_metadata = default_project_metadata ( ISSUER . into ( ) ) ;
214
- let evaluations = inst. generate_successful_evaluations ( project_metadata. clone ( ) , 5 ) ;
215
- let bids = inst. generate_bids_from_total_ct_percent ( project_metadata. clone ( ) , 95 , 8 ) ;
210
+ let evaluations = inst. generate_successful_evaluations ( project_metadata. clone ( ) , 10 ) ;
211
+ let bids = inst. generate_bids_from_total_ct_percent ( project_metadata. clone ( ) , 95 , 30 ) ;
216
212
let project_id = inst. create_finished_project ( project_metadata, ISSUER . into ( ) , None , evaluations, bids) ;
217
213
218
214
assert_eq ! (
@@ -221,12 +217,12 @@ fn create_project_with_unsettled_participation(participation_type: Participation
221
217
) ;
222
218
let evaluations_to_settle =
223
219
pallet_funding:: Evaluations :: < PolimecRuntime > :: iter_prefix_values ( ( project_id, ) ) . collect_vec ( ) ;
224
- let bids_to_settle = pallet_funding :: Bids :: < PolimecRuntime > :: iter_prefix_values ( ( project_id , ) ) . collect_vec ( ) ;
220
+ let bids_to_settle = inst . get_bids ( project_id ) ;
225
221
226
222
let mut participants: Vec < AccountId > = evaluations_to_settle
227
223
. iter ( )
228
224
. map ( |eval| eval. evaluator . clone ( ) )
229
- . chain ( bids_to_settle. iter ( ) . map ( |bid| bid . bidder . clone ( ) ) )
225
+ . chain ( bids_to_settle. iter ( ) . map ( |x| x . bidder . clone ( ) ) )
230
226
. collect ( ) ;
231
227
participants. sort ( ) ;
232
228
participants. dedup ( ) ;
@@ -242,14 +238,15 @@ fn create_project_with_unsettled_participation(participation_type: Participation
242
238
. unwrap ( )
243
239
}
244
240
245
- let start = if participation_type == ParticipationType :: Bid { 1 } else { 0 } ;
246
- for bid in bids_to_settle[ start..] . iter ( ) {
247
- PolimecFunding :: settle_bid ( RuntimeOrigin :: signed ( alice ( ) ) , project_id, bid. bidder . clone ( ) , bid. id ) . unwrap ( )
241
+ let proposed_start = if participation_type == ParticipationType :: Bid { 1 } else { 0 } ;
242
+ let end = if proposed_start == 1 { bids_to_settle. len ( ) - 1 } else { bids_to_settle. len ( ) } ;
243
+ for bid in bids_to_settle[ ..end] . iter ( ) {
244
+ PolimecFunding :: settle_bid ( RuntimeOrigin :: signed ( alice ( ) ) , project_id, bid. id ) . unwrap ( )
248
245
}
249
246
250
247
let evaluations =
251
248
pallet_funding:: Evaluations :: < PolimecRuntime > :: iter_prefix_values ( ( project_id, ) ) . collect_vec ( ) ;
252
- let bids = pallet_funding:: Bids :: < PolimecRuntime > :: iter_prefix_values ( ( project_id, ) ) . collect_vec ( ) ;
249
+ let bids = pallet_funding:: Bids :: < PolimecRuntime > :: iter_prefix_values ( project_id) . collect_vec ( ) ;
253
250
254
251
if participation_type == ParticipationType :: Evaluation {
255
252
assert_eq ! ( evaluations. len( ) , 1 ) ;
0 commit comments