Commit 23950d1
chore(helium-sub-daos): make the top-up mint-once gate falsifiable (#1285)
The gate deciding which issue_rewards_v0 pass mints the epoch's DAO-level backstop
top-up is covered by nothing: every suite issues rewards for a single sub-DAO, so
num_rewards_issued is 0 on the only pass and the condition is a no-op. Removing it
changes no test.
Extract it as mints_top_up(is_mobile, num_rewards_issued), which closes crate::TESTING
over, delegating to a private mints_top_up_with(is_mobile, testing, num_rewards_issued)
that the tests supply directly. TESTING is false under cargo test, so the first-pass arm
is reachable no other way; keeping the seam private means the value production runs on
is the constant rather than anything a caller chooses.
Verified by mutation, one term at a time, with the diff confirmed byte-identical after
each restore:
drop is_mobile -> a_non_mobile_pass_never_mints
invert !testing -> only_the_first_pass_mints_under_testing
drop the testing conjunct -> only_the_first_pass_mints_under_testing
n == 0 -> n <= 1 -> only_the_first_pass_mints_under_testing
literal for crate::TESTING -> the_wrapper_passes_the_build_s_own_testing_value
The wrapper test branches on crate::TESTING so each arm asserts what its build promises,
and each catches one substituted literal. The suite is green under both cargo test and
TESTING=true cargo test.
No behaviour change: the expression and the constant it reads are the ones already in
issue_rewards_v0.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 7af85df commit 23950d1
2 files changed
Lines changed: 81 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
292 | 313 | | |
293 | 314 | | |
294 | 315 | | |
| |||
511 | 532 | | |
512 | 533 | | |
513 | 534 | | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
514 | 593 | | |
515 | 594 | | |
516 | 595 | | |
| |||
Lines changed: 2 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 238 | + | |
249 | 239 | | |
250 | | - | |
| 240 | + | |
251 | 241 | | |
252 | 242 | | |
253 | 243 | | |
| |||
0 commit comments