You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ideally, shank would expose a macro that allowed me to redeploy my program with instructions to manage an on-chain IDL.
#[derive(ShankInstruction,ShankIdlDeploy)]pubenumMyProgramInstruction{
...
}// now if you fail to handle ShankIdlDeployParse -> fail in compiler// ShankIdlDeployParse// now you add the following...
processor::parse_shank_idl_parse(program_id,&accounts, program_data)// which then does the followingpubfn ....(){let disc:ShankIdlInnerInstruction = parse(data)?;match disc {ShankIdlInnerInstruction::CreateIdl =>
shank::idl::create(program_id,&accounts, program_data)?
ShankIdlInnerInstruction::CreateBuffer =>
shank::idl::create_buffer(program_id,&accounts, program_data)?
ShankIdlInnerInstruction::WriteIdl =>
shank::idl::write(program_id,&accounts, program_data)?
ShankIdlInnerInstruction::SetAuthority =>
shank::idl::set_authority(program_id,&accounts, program_data)?
ShankIdlInnerInstruction::SetBuffer =>
shank::idl::set_buffer(program_id,&accounts, program_data)?
}}
ngundotra
changed the title
[feat]: Export PDA on-chain to write on-chain Anchor IDL
[feat]: Add #[idlinstruction] annotation to allow Shank programs to export shank'd IDL on-chain
Oct 29, 2022
ngundotra
changed the title
[feat]: Add #[idlinstruction] annotation to allow Shank programs to export shank'd IDL on-chain
[feat]: Add #[idl_instruction] annotation to allow Shank programs to export shank'd IDL on-chain
Oct 29, 2022
I think Shank would just need to feature flag the following code from
anchor
:https://github.com/coral-xyz/anchor/blob/fa1249836e2b8a73d3cb9fb525634e789290f251/lang/syn/src/codegen/program/handlers.rs#L19
The text was updated successfully, but these errors were encountered: