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

chore(target_chains/starknet): automate test data generation #1587

Merged
merged 1 commit into from
May 21, 2024

Conversation

Riateche
Copy link
Contributor

@Riateche Riateche commented May 20, 2024

Now, instead of manually copying output from test_vaas tool to the cairo tests, we can simply run a command to automatically generate data.cairo that contains all the generated data. I've also expanded comments for each item. Main test files (pyth.cairo and wormhole.cairo) should be more readable now. I've also added a CI check to ensure that generate_test_data.rs and data.cairo stay in sync. There are no significant code changes, just a lot of moving code around.

Copy link

vercel bot commented May 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
example-oracle-amm ⬜️ Ignored (Inspect) Visit Preview May 20, 2024 0:37am
xc-admin-frontend ⬜️ Ignored (Inspect) Visit Preview May 20, 2024 0:37am

@Riateche Riateche force-pushed the starknet-automate-test-data branch 2 times, most recently from cb28c5c to 16167c0 Compare May 20, 2024 12:25
@Riateche Riateche changed the title WIP: chore(target_chains/starknet): automate test data generation chore(target_chains/starknet): automate test data generation May 20, 2024
@Riateche Riateche force-pushed the starknet-automate-test-data branch from 16167c0 to 992f7be Compare May 20, 2024 12:37
@Reisen
Copy link
Contributor

Reisen commented May 20, 2024

These are great test VAA's and I'd call these golden tests even, am +1'ing but want to ask if you think we could rip these out and apply these to all the contracts rather than just this one? It's something we wanted a little while ago and can probably take advantage of for modifying other contracts (or introducing new ones).

@Riateche
Copy link
Contributor Author

Yes, I think we can use this implementation for other tests as well. Apart from calldata encoding, there is nothing specific to starknet in these tests.

@Riateche Riateche merged commit 74f02c4 into main May 21, 2024
6 checks passed
@Riateche Riateche deleted the starknet-automate-test-data branch May 21, 2024 10:33
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