What does the error for A raw constraint was violated
mean?
errorCode: { code: 'ConstraintRaw', number: 2003 },
errorMessage: 'A raw constraint was violated',
These are the types of constraints defined using this syntax #[account(constraint = <expr>)]
.
From the anchor documentation:
Constraint that checks whether the given expression evaluates to true.
Use this when no other constraint fits your use case.
Example:
#[account(constraint = one.keys[0].age == two.apple.age)]
pub one: Account<'info, MyData>,
pub two: Account<'info, OtherData>