Skip to content

[#45] Update E2E scripts for post-#38 contract changes#50

Merged
realproject7 merged 3 commits intomainfrom
task/45-e2e-post-update
Mar 20, 2026
Merged

[#45] Update E2E scripts for post-#38 contract changes#50
realproject7 merged 3 commits intomainfrom
task/45-e2e-post-update

Conversation

@realproject7
Copy link
Owner

Summary

  • Update factory address to new deployment (0x27B4FCf333f29a3865b3B76ea00C955D7b64BD0F)
  • Add 5 new test scenarios to revert script:
    • E10: empty title in chainPlot
    • E11: zero hash in createStoryline
    • E12: zero hash in chainPlot
    • E13: non-owner updateCurve
    • G1: hasSunset view on active storyline
  • Revert script now covers 16 scenarios (was 11)

Test plan

  • All 45 unit tests pass
  • forge fmt --check clean
  • E2E broadcast runs against new deployment
  • E2E revert script passes all 16 scenarios

Fixes #45

🤖 Generated with Claude Code

- Update factory address to new deployment (0x27B4...BD0F)
- Add revert scenarios: E10 (empty title chainPlot), E11 (zero hash
  create), E12 (zero hash chainPlot), E13 (non-owner updateCurve)
- Add G1: hasSunset view test on active storyline
- Revert script now tests 16 scenarios (was 11)

All 45 unit tests pass.

Fixes #45

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b Review — APPROVED

  • Factory address updated to new deployment in both scripts
  • E10-E12: correctly test the new validations from #42 (empty title, zero hash) with proper writer context via vm.prank(deployer) where needed
  • E13: non-owner updateCurve reverts on onlyOwner modifier before reaching validation — correct
  • G1: hasSunset view tested against live mainnet state — correct since idA1 comes from e2e-results.json produced by the new deployment

All new scenarios follow the existing try/catch + reason-check pattern. LGTM.

Copy link
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The PR updates the deployed factory address and adds some new revert coverage, but it does not yet satisfy the post-#38 E2E scope from issue #45. Several required new contract behaviors are still unexercised in the scripts.

Findings

  • [high] The new updateCurve() functionality is only covered for the non-owner revert path; the E2E scripts still do not test the owner success path or that a new storyline created after updateCurve() uses the updated curve.

    • File: script/E2ETestReverts.s.sol:178
    • Suggestion: add a happy-path owner updateCurve() scenario in the broadcastable script and then create a new storyline afterward to verify the updated curve is actually used, as required by issue #45.
  • [high] hasSunset() coverage is incomplete. The PR only checks the false case on an active storyline, but issue #45 explicitly calls for active vs expired coverage.

    • File: script/E2ETestReverts.s.sol:198
    • Suggestion: add a second hasSunset() scenario for an expired deadline-enabled storyline and assert it returns true.
  • [medium] The newly-added constructor validations from issue #42 are still not represented in the post-update E2E scripts.

    • File: script/E2ETestReverts.s.sol:149
    • Suggestion: add scenarios covering the zero-address constructor guards and the >1000 step-array cap, or document and implement an equivalent runtime path if constructor-level validation is being exercised another way. Right now the PR adds only title/hash/updateCurve-owner coverage.

Decision

Requesting changes because the PR only partially updates the E2E scripts for the post-#38 contract behavior and leaves multiple required scenarios uncovered.

…tructor guards

Broadcast script:
- F6: updateCurve by owner + create storyline with new curve

Revert script:
- G2: hasSunset on expired/warped deadline (simulation only)
- H1: constructor zero bond address revert
- H2: constructor zero token address revert
- H3: constructor >1000 steps revert
- Revert script now covers 21 scenarios (was 16)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The PR covers more of the post-#38 surface area now, but two acceptance-criteria items are still not actually exercised end-to-end. One of the new scenarios is unreachable on the current data, and the new curve scenario still does not verify that the updated curve was used.

Findings

  • [high] The new hasSunset() expired-path check still never exercises an expired storyline, because it uses storylineA2, which the broadcast script creates with hasDeadline = false.

    • File: script/E2ETestReverts.s.sol:202
    • Suggestion: use a storyline that was actually created with a deadline enabled (for example storylineA1 after warping far enough) and assert hasSunset() becomes true. As written, G2 only re-tests the false case.
  • [medium] F6 demonstrates that the owner can call updateCurve() and then create another storyline, but it still does not verify that the newly created storyline actually used the updated curve parameters.

    • File: script/E2ETest.s.sol:437
    • Suggestion: add an assertion tied to the new curve, such as reading back a downstream observable that depends on the updated step ranges/prices or otherwise proving the post-update create path consumed the new curve, since issue #45 explicitly calls for this scenario.

Decision

Requesting changes because the post-update E2E coverage is still missing a real expired-hasSunset() assertion and a proof that updateCurve() affects subsequent storyline creation.

…urve

- G2: use storylineA1 (hasDeadline=true) for expired hasSunset test
- F6: buy 1 token after updateCurve, assert cost > 1.5e15 to prove
  the new curve (2e15 first step) was applied vs original (1e15)
- Extract _verifyF6() to avoid stack-too-deep in _groupF()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The follow-up completes the missing post-#38 E2E coverage: hasSunset() now exercises the expired path on a deadline-enabled storyline, and the updateCurve() happy path now proves the updated curve is actually applied by asserting the higher mint cost on the newly-created storyline. The additional constructor-validation scenarios are also present, and GitHub checks are passing.

Findings

  • None.

Decision

Approving because the review blockers are resolved and the updated E2E scripts now cover the required post-update contract behavior.

@realproject7 realproject7 merged commit 3841aee into main Mar 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Test] Update E2E scripts for post-#38 contract changes

2 participants