Anchor
ConstraintHasOne
“A has one constraint was violated”
A has_one = field constraint failed: the account's stored field does not equal the address of the account passed under that name.
Common causes
- Passing a different
authority/owner/mintaccount than the one stored on the account. - The account was created for a different user.
How to fix it
- Fetch the account, read the field named in the constraint and pass that exact address.
- Name the accounts in the client call carefully; Anchor matches by field name.