Skip to content

fix: correct the conditions in requires.rs and return granular error - #101

Merged
snawaz merged 1 commit into
mainfrom
snawaz/fix/fix-older-buys
Oct 13, 2025
Merged

snawaz merged 1 commit into
mainfrom
snawaz/fix/fix-older-buys

Conversation

@snawaz

@snawaz snawaz commented Oct 12, 2025 •

Copy link
Copy Markdown
Collaborator

As discussed in #94 (comment), this PR fixes the conditions in requires.rs (which was copied verbatim from loaders.rs — fixed that as well).

Summary by CodeRabbit

  • Bug Fixes
    • Standardized errors when attempting to write to read-only accounts: now returns “Immutable” instead of a generic invalid data error, providing clearer feedback.
    • Consistent behavior across account loading and PDA-related operations.
  • Refactor
    • Simplified writable checks for improved clarity, also correcting the behavior for valid writable accounts.

snawaz commented Oct 12, 2025 •

Copy link
Copy Markdown
Collaborator Author

@snawaz
snawaz requested a review from GabrielePicco October 13, 2025 04:02
@magicblock-labs magicblock-labs deleted a comment from coderabbitai Bot Oct 13, 2025
@snawaz
snawaz force-pushed the snawaz/fix/fix-older-buys branch from 2119f40 to 18ca987 Compare October 13, 2025 04:12
@snawaz
snawaz marked this pull request as ready for review October 13, 2025 04:26
@magicblock-labs magicblock-labs deleted a comment from coderabbitai Bot Oct 13, 2025

@GabrielePicco GabrielePicco left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@magicblock-labs magicblock-labs deleted a comment from coderabbitai Bot Oct 13, 2025
@snawaz
snawaz merged commit 33905ad into main Oct 13, 2025
5 checks passed
@snawaz
snawaz deleted the snawaz/fix/fix-older-buys branch October 13, 2025 06:31
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.

2 participants