exotic-markets / crayfish

0 stars 1 forks source link

Add a simple way to create accounts #4

Open Dodecahedr0x opened 6 days ago

Dodecahedr0x commented 6 days ago

The Account trait verifies that the account exists, the UncheckedAccount does not let you retrieve account data when initialized within the instruction.

I suggest having either an annotation on the context that specifies that the account requires creation or a lazy context that lets the program dev manage when to create the account. The former could make the code more compact but requires more contexts, the latter could be more efficient by allowing the dev to make some checks before allocating the account.