Open sol-mocha opened 1 year ago
@gagliardetto wondering if you can give some insight into the open question I have in the PR description. Do you anticipate any issues with the new code in relation to optional accounts?
Here is a real life example using these changes. Its applied on the drip program idl.
Hey @dcaf-mocha
Sorry for the delay in getting back to you.
Thanks for the PR! That's a great idea.
From what I remember:
Description
This PR updates the code gen in
main.go
to create structs for instruction accounts, as well as a helper to populate said structs given the AccountMetaSlice in the instruction builder. This will allow devs to safely access instruction accounts in a readable way without having to write their own converters and types.Open Questions
Example
idl/examples/composite.json
now produces the following extra code