-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update error wording to reflect actual cause #1154
Conversation
aa7b7e6
to
6178141
Compare
6178141
to
89a97d8
Compare
@losman0s pls sign the commits in this pr and force push |
ac64f9c
to
9fac17d
Compare
@paul-schaaf Done |
this is not correct btw. this error is not thrown when an |
because this is wrong, the changelog isnt quite accurate either. this change does not affect the owner validation macro. It's the |
9fac17d
to
564ef40
Compare
@paul-schaaf Does the updated PR description and changelog fit better now? |
@losman0s yes |
Problem
Error message thrown in case of wrong account ownership is too restrictive, and can mislead the developer.
Any
Account<'info, XXX>
in an endpoint'sderive(Accounts)
struct is automatically validated at runtime to be owned by the program (~crate) it was created in (c.f. here for the check, and here to see how the#[account]
macro automatically sets an account struct's owner). However, when a client call provides an account owned by an unexpected program, the validation fails (good) with the confusing error messageThe given account is not owned by the executing program
(bad).This does not reflect that fact that an account can very well be owned by any program other than the one executing.
Summary of Changes
Move to suggested error enum name and error message:
Fixes #1100