Skip to content

[#39] Drain pending royalties before D2 revert test#40

Merged
realproject7 merged 1 commit intomainfrom
task/39-d2-drain-fix
Mar 20, 2026
Merged

[#39] Drain pending royalties before D2 revert test#40
realproject7 merged 1 commit intomainfrom
task/39-d2-drain-fix

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Drain any pending royalties before D2 empty-claim revert assertion
  • F5 buy/sell in the broadcast script generates new royalties after D1 claims, so the revert script's D2 test needs to drain first

Test plan

  • Build passes
  • Verified on mainnet: revert script passes all 11 scenarios with this fix

Fixes #39

🤖 Generated with Claude Code

The broadcast script's F5 (buy/sell) generates new royalties after D1
claims. When the revert script runs afterward, the deployer has
unclaimed royalties, so the D2 empty-claim test passes for the wrong
reason. Fix: drain any pending royalties first, then test the revert.

Fixes #39

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
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. Correct fix — drains residual royalties from F5 before asserting empty-claim revert. vm.prank(deployer) on both the drain and the test call is correct.

Copy link
Copy Markdown
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

This change fixes the D2 setup ambiguity by draining any pending royalties in the deployer context before asserting the empty-claim revert. That preserves the intended double-claim semantics after the split-script refactor.

Findings

  • None.

Decision

Approving because the PR directly addresses the reported royalty-drain bug and GitHub checks are passing.

@realproject7 realproject7 merged commit 1390c31 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.

[Bug] Revert E2E Script Must Drain Royalties Before Empty-Claim Test

2 participants