refactor: add opt fee payer to revoke and approve instructions#2306
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughRefactors approve/revoke instruction handling to separate an "owner" account and an optional "fee_payer" account. Constants and call sites were updated; Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@programs/compressed-token/program/src/ctoken/approve_revoke.rs`:
- Around line 104-105: Doc comment for the account index constants is stale:
update the FEE_PAYER_IDX description near the OWNER_IDX/FEE_PAYER_IDX doc block
in approve_revoke.rs to read "(4 for approve, 3 for revoke)" (leave OWNER_IDX as
"2 for approve, 1 for revoke"); locate the doc comment that currently shows the
wrong values and replace only the FEE_PAYER_IDX tuple so the comment matches the
actual indexing used by handle_compressible_top_up and approve/revoke logic.
- Around line 75-76: The doc comment for FEE_PAYER_IDX has incorrect index
numbers; update the text to match the actual constants APPROVE_FEE_PAYER_IDX = 4
and REVOKE_FEE_PAYER_IDX = 3 (i.e. "4 for approve, 3 for revoke") so it no
longer mirrors the OWNER_IDX values and correctly documents the fee payer
account positions.
owner=2, fee_payer=4; Revoke: owner=1, fee_payer=3) with system program placement documented
FEE_PAYER_IDX) instead of two
Summary by CodeRabbit