Open febo opened 1 year ago
Yeah this would be tricky to implement since at this point we go through the written code and find structs that are annotated with either BorshSerialize
or BorshDeserialize
to include them as custom types.
cargo expand
might work, but could also result in other issues due to annotations of expanded macros no longer being present in the result, etc. It's not gonna be a simple solution I'm afraid.
At any rate the changes for this need to happen in shank, so I moved the issue here (from solita).
Summarizing our chat here:
cargo expand
). At this point, the types to be exported do not need to have any annotations. Any type referenced by the types exported in the first-pass would be included.
Solita currently does not support Rust macro generated types, resulting in an error:
A potential solution would be to use
cargo expand
to run the macros and then look up any type not found in the source code.