coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.36k stars 1.25k forks source link

idl: Fix using `address` constraint with field expressions #3034

Closed acheroncrypto closed 1 week ago

acheroncrypto commented 2 weeks ago

Problem

Using address = <ACCOUNT>.<FIELD> does not compile with the current IDL generation as explained in https://github.com/coral-xyz/anchor/issues/2912.

Summary of changes

Skip including address field in the IDL if field access expression is being used with the address constraint.

Note that using has_one should be preferred (like I mentioned in https://github.com/coral-xyz/anchor/issues/2912#issuecomment-2061172476) as it also supports automatic resolution.

Resolves https://github.com/coral-xyz/anchor/issues/2912

vercel[bot] commented 2 weeks ago

@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.