Commit de7e4fe
committed
test(bonds): anchor auctionDiscountBps assertions to the specific guard
Both arkanaai (O1) and CodeRabbit's review of #38 flagged the same
test-quality issue on tests/repayment_pool_test.rs:276-281 (and the
parallel rollIn assertion at 694-698): the original
assert!(gte >= 1, ...)
on OP_GREATERTHANOREQUAL64 was too loose. issue() emits five other
asset-amount `>=` checks (output.assets.lookup(...) >= N), so deleting
the `auctionDiscountBps >= 0` guard would drop GTE64 from 6 to 5 —
still >= 1, still passing.
Replaced both sites with a targeted 3-token window check:
contains_window_3(output, fn_name,
"<auctionDiscountBps>", "OP_GREATERTHANOREQUAL", "0")
plus the symmetric `< 10000` check
contains_window_3(output, fn_name,
"<auctionDiscountBps>", "OP_LESSTHAN", "10000")
The helper accepts any permutation of the three tokens within a 3-token
sliding window (the emitter's display order for the discount comparison
is `<auctionDiscountBps> OP_GREATERTHANOREQUAL 0`, which is not strict
postfix; the set-equality test is robust to that emitter quirk and to
future reordering).
Verified by regression injection: deleting `require(auctionDiscountBps
>= 0, ...)` from issue() makes test_issue_enforces_deployment_invariants
fail with the message
"issue must carry the `auctionDiscountBps >= 0` deployment guard
(expected window of <auctionDiscountBps>, OP_GREATERTHANOREQUAL, 0
within 3 consecutive ASM tokens of `issue`)"
restoring the guard makes the test pass. Same behaviour for rollIn.
Tests: 256/256 (unchanged total — the asserts changed shape but not
count). cargo fmt --check clean.1 parent e6f4aea commit de7e4fe
1 file changed
Lines changed: 84 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
281 | 305 | | |
282 | 306 | | |
283 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
284 | 331 | | |
285 | 332 | | |
286 | 333 | | |
| |||
691 | 738 | | |
692 | 739 | | |
693 | 740 | | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
698 | 767 | | |
699 | 768 | | |
700 | 769 | | |
| |||
0 commit comments