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

Deserialize Vec of Accounts #69

Open
armaniferrante opened this issue Feb 6, 2021 · 6 comments
Open

Deserialize Vec of Accounts #69

armaniferrante opened this issue Feb 6, 2021 · 6 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed lang

Comments

@armaniferrante
Copy link
Member

Consider implementing the Accounts trait for Vec, where all accounts in the &[AccountInfo] slice are consumed and deserialized into the vec.

@armaniferrante armaniferrante added good first issue Good for newcomers help wanted Extra attention is needed labels Feb 7, 2021
@CanardMandarin
Copy link
Contributor

Trying to start with this good first issue.
How does that commit look ? CanardMandarin/anchor@bd5f815

@armaniferrante
Copy link
Member Author

Looks great. Let's add a test.

@armaniferrante
Copy link
Member Author

The remaining work here is to allow one to use Vec<Accounts> in the #[derive(Accounts)] struct and the client.

@Lev-Stambler
Copy link

Lev-Stambler commented Aug 29, 2021

Hi, I was wondering where the derive(Accounts) for the Vec was coming/ if any help was wanted (as I need it for my current project).

I was also wondering which trait's need to be implemented in order to get Vec working in the derive. Currently, the error returned is just use of undeclared crate or module __client_accounts_vec

@mccjul
Copy link
Contributor

mccjul commented Sep 20, 2021

The reason for this error is due to the fact that it is treating the Vec as a composite field (Account<'info, SomeAccount>). Which I don't think is the result we want am I right @armaniferrante?

@secretshardul
Copy link
Contributor

Any progress on this issue? Anything we could do to hammer it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed lang
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants