Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse context account into instruction accounts #58

Open
zhmoly opened this issue Jun 15, 2022 · 4 comments
Open

Parse context account into instruction accounts #58

zhmoly opened this issue Jun 15, 2022 · 4 comments
Labels
awaiting-response Awaiting response from person filing the issue for more clarification before we can proceed

Comments

@zhmoly
Copy link

zhmoly commented Jun 15, 2022

Hi, there
I'm using solita as useful framework.
By the way, I found some issue.

I'm using anchor and includes context into instruction.

#[derive(Accounts)]
pub struct SetSubModule<'info> {
    module_ctx: SetModule<'info>,

    #[account(mut)]
    pub signer: UncheckedAccount<'info>,
}

But when I try with Solita, get error.

Generating TypeScript SDK to /home/john/Documents/personal/unloc-contracts/client-generated/src/generated
/home/john/Documents/personal/unloc-contracts/client-generated/node_modules/@metaplex-foundation/solita/dist/src/render-instruction.js:92
      isWritable: ${isMut.toString()},
                          ^

TypeError: Cannot read properties of undefined (reading 'toString')
    at /home/john/Documents/personal/unloc-contracts/client-generated/node_modules/@metaplex-foundation/solita/dist/src/render-instruction.js:92:27

Is there any way to resolve this error?
Any help will be appreciated.

Regards,
John

@thlorenz
Copy link
Contributor

thlorenz commented Jul 8, 2022

Sorry it is really hart to parse what you're requesting.

Could you please properly format the code blocks as well as the error messages using github markdown features?
See here.

Thanks

@thlorenz thlorenz added the awaiting-response Awaiting response from person filing the issue for more clarification before we can proceed label Sep 3, 2022
@roberts-pumpurs
Copy link

If I understood correctly, the issue that he's facing right now is that for some reason Solita is unable to parse the module_ctx: SetModule<'info> structure.

I am facing a similar issue, where I have a structure identified with #[derive(Accounts)], it has a field which is also attributed as #[derive(Accounts)]. Because of this field, Solita fails exactly as described in the original post.

@thlorenz
Copy link
Contributor

OK I think I understand a bit better now.
Could you please provide the IDL that solita is operating on when encountering those errors?
And I assume that IDL is generated with anchor?

@thlorenz
Copy link
Contributor

thlorenz commented Nov 1, 2022

Hi, I cannot help you unless you provide some Rust code that reproduces the problem or the IDL that shank produced.

My guess is that shank trips on the life time 'info and fails to even generate the IDL, but without some sample code I'm left guessing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-response Awaiting response from person filing the issue for more clarification before we can proceed
Projects
None yet
Development

No branches or pull requests

3 participants