You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With space being determined by the generic provided to Account<>?
The programmer's intention is to store a struct of a particular type. The fact that the account needs to match the size of the struct is really a dependency of that goal. Also it's easier to reason about!
The text was updated successfully, but these errors were encountered:
Yeah, I've been working on something related that also requires automatic space calculation, so I'm thinking about making the space constraint optional again (it was like that a long time ago).
So right now we tell Anchor that space is derived from the (currently constant) discriminator size plus INIT_SPACE for the struct:
And as you mentioned in #3005 we could have just SPACE (including whatever size the discriminator is):
Is there any reason we couldn't do something like:
or even:
With
space
being determined by the generic provided toAccount<>
?The programmer's intention is to store a struct of a particular type. The fact that the account needs to match the size of the struct is really a dependency of that goal. Also it's easier to reason about!
The text was updated successfully, but these errors were encountered: