make validator account optional in delegate_permission instruction - #203
make validator account optional in delegate_permission instruction#203dhruvja wants to merge 2 commits into
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 46 minutes and 55 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe Suggested reviewers
✨ 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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@rust/tests/access_control_test.rs`:
- Around line 160-193: Add a companion test that exercises the Some(validator)
branch: create unique Pubkey values like in
test_delegate_permission_builder_without_validator, set
builder.validator(Some(validator_pubkey)), call builder.instruction() (or
instruction_with_remaining_accounts() if used), and assert
instruction.program_id == PERMISSION_PROGRAM_ID, instruction.accounts.len() ==
11, instruction.accounts[0].pubkey == payer, and that the validator_pubkey
appears at instruction.accounts[10].pubkey to pin the extra-account ordering for
the Some branch of DelegatePermissionBuilder.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 180a0947-e100-4fb4-a101-a052c5edc370
📒 Files selected for processing (2)
rust/sdk/src/access_control/instructions/delegate_permission.rsrust/tests/access_control_test.rs
…or delegation permission
The
delegate_permissioninstruction has the validator account as optional but theDelegatePermissionstruct enforces to have passed the validator key.Summary by CodeRabbit
Bug Fixes
Tests