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

Extend use statements and Data Accounts paths for fuzz snapshots #141

Merged
merged 6 commits into from
Mar 12, 2024

Conversation

lukacan
Copy link
Collaborator

@lukacan lukacan commented Mar 9, 2024

Currently, once the accounts_snapshots.rs file is generated, users need to manually import the structures stored inside the Data Accounts. This PR addresses this issue by obtaining full paths (if possible) to the defined types, employing the same logic used for obtaining full paths to the Instruction input arguments for .program_client.

The Test generator has been updated to consolidate all extracted data into a single vector called programs_data, rather than using separate fields for IDL and data required for the fuzzer.

Additional minor updates include:

  • Adding use crate::PROGRAM_ID, as it is often used within accounts_snapshots.rs and is available inside test_fuzz.rs.
  • Implementing small updates to the outputs to enhance the user experience.

@lukacan lukacan requested a review from Ikrk March 9, 2024 14:53
@lukacan lukacan force-pushed the fix/import-custom-types branch 2 times, most recently from 6776115 to 23206f1 Compare March 10, 2024 11:18
@Ikrk
Copy link
Contributor

Ikrk commented Mar 11, 2024

lgtm. good job. Just some minor comments...
Also, we have to keep in mind, that the SPL data types and also the composite accounts types are not imported. So in these cases the user will still have to import it manually.

@Ikrk Ikrk self-requested a review March 11, 2024 10:59
Copy link
Contributor

@Ikrk Ikrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. good job. Just some minor comments...
Also, we have to keep in mind, that the SPL data types and also the composite accounts types are not imported. So in these cases the user will still have to import it manually.

@lukacan lukacan requested a review from Ikrk March 12, 2024 11:43
@Ikrk Ikrk merged commit f9b8286 into develop Mar 12, 2024
8 checks passed
@Ikrk Ikrk deleted the fix/import-custom-types branch March 12, 2024 14:14
lukacan added a commit that referenced this pull request May 20, 2024
…ts (#141)

* ✨ Extend use statements and Data Accounts paths for fuzz snapshots

* 🐛 PR Fix: change tuple to struct and update correspondig code

* 🐛 PR Fix: update accounts_snapshots.rs program_id import

* 🐛 PR Fix: update variable names

* 🐛 PR Fix: update unwrap_or into unwrap_or_else

* 🐛 PR Fix: update regular expressions and add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants