Currently, sharing types across programs is quite annoying to do because we need to typically wrap our external type in a new type and implement AnchorSerialize and AnchorSerialize by hand. This could be easily fixed by just having declare_program! derive this trait automatically in its generated code for the types found in the idl. I'm unsure if this doesn't bring other problems with it though which is why I'm opening this as an issue first instead of a PR (although I don't expect this to, as declare_program! already does this, and more, for accounts.
Currently, sharing types across programs is quite annoying to do because we need to typically wrap our external type in a new type and implement
AnchorSerialize
andAnchorSerialize
by hand. This could be easily fixed by just havingdeclare_program!
derive this trait automatically in its generated code for the types found in the idl. I'm unsure if this doesn't bring other problems with it though which is why I'm opening this as an issue first instead of a PR (although I don't expect this to, asdeclare_program!
already does this, and more, for accounts.