|
55 | 55 | ], |
56 | 56 | id="single_block_single_consolidation_request_from_eoa", |
57 | 57 | ), |
| 58 | + pytest.param( |
| 59 | + [ |
| 60 | + [ |
| 61 | + ConsolidationRequestTransaction( |
| 62 | + requests=[ |
| 63 | + ConsolidationRequest( |
| 64 | + source_pubkey=0x01, |
| 65 | + target_pubkey=0x01, |
| 66 | + fee=Spec.get_fee(0), |
| 67 | + ) |
| 68 | + ], |
| 69 | + ), |
| 70 | + ], |
| 71 | + ], |
| 72 | + id="single_block_single_consolidation_request_from_eoa_equal_pubkeys", |
| 73 | + ), |
| 74 | + pytest.param( |
| 75 | + [ |
| 76 | + [ |
| 77 | + ConsolidationRequestTransaction( |
| 78 | + requests=[ |
| 79 | + ConsolidationRequest( |
| 80 | + source_pubkey=-1, |
| 81 | + target_pubkey=-2, |
| 82 | + fee=Spec.get_fee(0), |
| 83 | + ) |
| 84 | + ], |
| 85 | + ), |
| 86 | + ], |
| 87 | + ], |
| 88 | + id="single_block_single_consolidation_request_from_eoa_max_pubkeys", |
| 89 | + ), |
58 | 90 | pytest.param( |
59 | 91 | [ |
60 | 92 | [ |
|
64 | 96 | source_pubkey=0x01, |
65 | 97 | target_pubkey=0x02, |
66 | 98 | fee=0, |
| 99 | + valid=False, |
67 | 100 | ) |
68 | 101 | ], |
69 | 102 | ), |
|
168 | 201 | ) |
169 | 202 | ], |
170 | 203 | ], |
| 204 | + marks=pytest.mark.skip( |
| 205 | + reason="duplicate test due to MAX_CONSOLIDATION_REQUESTS_PER_BLOCK==1" |
| 206 | + ), |
171 | 207 | id="single_block_max_consolidation_requests_from_eoa", |
172 | 208 | ), |
173 | 209 | pytest.param( |
|
262 | 298 | ), |
263 | 299 | pytest.param( |
264 | 300 | [ |
265 | | - # Block 1 |
266 | 301 | [ |
267 | 302 | ConsolidationRequestTransaction( |
268 | 303 | requests=[ |
|
271 | 306 | target_pubkey=i * 2 + 1, |
272 | 307 | fee=Spec.get_fee(0), |
273 | 308 | ) |
274 | | - for i in range(Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK * 2) |
| 309 | + for i in range(Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK * 5) |
275 | 310 | ] |
276 | 311 | ) |
277 | 312 | ], |
278 | | - # Block 2, no new consolidation requests, but queued requests from previous block |
279 | | - [], |
280 | | - # Block 3, no new nor queued consolidation requests |
281 | | - [], |
282 | 313 | ], |
283 | 314 | id="multiple_block_above_max_consolidation_requests_from_eoa", |
284 | 315 | ), |
|
308 | 339 | target_pubkey=i * 2 + 1, |
309 | 340 | fee=Spec.get_fee(0), |
310 | 341 | ) |
311 | | - for i in range( |
312 | | - Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK |
313 | | - ) # TODO: MAX_CONSOLIDATION_REQUESTS_PER_BLOCK not ideal |
| 342 | + for i in range(Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK * 5) |
314 | 343 | ], |
315 | 344 | ), |
316 | 345 | ], |
|
334 | 363 | target_pubkey=i * 2 + 1, |
335 | 364 | fee=Spec.get_fee(0), |
336 | 365 | ) |
337 | | - for i in range( |
338 | | - 1, Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK |
339 | | - ) # TODO: MAX_CONSOLIDATION_REQUESTS_PER_BLOCK not ideal |
| 366 | + for i in range(1, Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK * 5) |
340 | 367 | ], |
341 | 368 | ), |
342 | 369 | ], |
|
353 | 380 | target_pubkey=i * 2 + 1, |
354 | 381 | fee=Spec.get_fee(0), |
355 | 382 | ) |
356 | | - for i in range(Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK - 1) |
| 383 | + for i in range(Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK * 5) |
357 | 384 | ] |
358 | 385 | + [ |
359 | 386 | ConsolidationRequest( |
360 | 387 | source_pubkey=-1, |
361 | 388 | target_pubkey=-2, |
362 | 389 | fee=0, |
363 | 390 | ) |
364 | | - ], # TODO: MAX_CONSOLIDATION_REQUESTS_PER_BLOCK not ideal |
| 391 | + ], |
365 | 392 | ), |
366 | 393 | ], |
367 | 394 | ], |
|
388 | 415 | fee=Spec.get_fee(0), |
389 | 416 | valid=True, |
390 | 417 | ) |
391 | | - for i in range(1, Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK) |
| 418 | + for i in range(1, Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK * 5) |
392 | 419 | ], |
393 | | - ), # TODO: MAX_CONSOLIDATION_REQUESTS_PER_BLOCK not ideal |
| 420 | + ), |
394 | 421 | ], |
395 | 422 | ], |
396 | 423 | id="single_block_multiple_consolidation_requests_from_contract_first_oog", |
|
407 | 434 | gas_limit=1_000_000, |
408 | 435 | valid=True, |
409 | 436 | ) |
410 | | - for i in range(Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK) |
| 437 | + for i in range(Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK * 5) |
411 | 438 | ] |
412 | 439 | + [ |
413 | 440 | ConsolidationRequest( |
|
418 | 445 | valid=False, |
419 | 446 | ) |
420 | 447 | ], |
421 | | - ), # TODO: MAX_CONSOLIDATION_REQUESTS_PER_BLOCK not ideal |
| 448 | + ), |
422 | 449 | ], |
423 | 450 | ], |
424 | 451 | id="single_block_multiple_consolidation_requests_from_contract_last_oog", |
|
434 | 461 | fee=Spec.get_fee(0), |
435 | 462 | valid=False, |
436 | 463 | ) |
437 | | - for i in range(Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK) |
| 464 | + for i in range(Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK * 5) |
438 | 465 | ], |
439 | 466 | extra_code=Op.REVERT(0, 0), |
440 | 467 | ), |
441 | | - ], # TODO: MAX_CONSOLIDATION_REQUESTS_PER_BLOCK not ideal |
| 468 | + ], |
442 | 469 | ], |
443 | 470 | id="single_block_multiple_consolidation_requests_from_contract_caller_reverts", |
444 | 471 | ), |
|
453 | 480 | fee=Spec.get_fee(0), |
454 | 481 | valid=False, |
455 | 482 | ) |
456 | | - for i in range(Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK) |
| 483 | + for i in range(Spec.MAX_CONSOLIDATION_REQUESTS_PER_BLOCK * 5) |
457 | 484 | ], |
458 | 485 | extra_code=Macros.OOG(), |
459 | | - ), # TODO: MAX_CONSOLIDATION_REQUESTS_PER_BLOCK not ideal |
| 486 | + ), |
460 | 487 | ], |
461 | 488 | ], |
462 | 489 | id="single_block_multiple_consolidation_requests_from_contract_caller_oog", |
|
0 commit comments