Since https://github.com/codama-idl/codama/pull/43, we can now inline PdaNodes directly inside PdaValueNodes, allowing us to defined PDAs that are not defined at the top-level of the program, and therefore, don't need to render helper methods.
PR #42 is in the process of supporting these inlined PDAs when parsing an Anchor IDL.
This issue proposes two further improvements that needs discussing.
A. Add a default Anchor visitor after #42, that goes through relevant inlined PDAs and extracts them as top-level PdaNodes on the ProgramNode.
B. Potentially find a way to link an inlined variable Pda seed to an instruction argument to avoid type repetition. Note that this may make it more difficult for us to achieve A as top-level PdaNodes do not have access to the context of instruction arguments.
Since https://github.com/codama-idl/codama/pull/43, we can now inline
PdaNodes
directly insidePdaValueNodes
, allowing us to defined PDAs that are not defined at the top-level of the program, and therefore, don't need to render helper methods.PR #42 is in the process of supporting these inlined PDAs when parsing an Anchor IDL.
This issue proposes two further improvements that needs discussing.
A. Add a default Anchor visitor after #42, that goes through relevant inlined PDAs and extracts them as top-level
PdaNodes
on theProgramNode
.B. Potentially find a way to link an inlined variable Pda seed to an instruction argument to avoid type repetition. Note that this may make it more difficult for us to achieve A as top-level
PdaNodes
do not have access to the context of instruction arguments.Cc @kespinola