Closed ifiokjr closed 2 months ago
Fixed the compilation error in https://github.com/coral-xyz/anchor/pull/3087. However, note that using the owner
constraint with the Account
type is redundant because Account<T>
already checks T::owner() == account.owner
.
Description
The following code fails to compile:
The error produced is as follows.
The problem is caused by the
derive(Accounts)
macro which produces the following for both boxed and unboxed values.A fix would be to generate different code if the account is wrapped with
Box
.Changing the first line of the macro output to the following resolves the issue.
Current Workaround
For those looking for a temporary workaround, you can use the
constraint
in the following way to replicate the behaviour.