cairo-vm
cairo-vm copied to clipboard
Add CLI option to specify entrypoint
Configurable entrypoint
Description
As described in #180, it might be useful to be able to run another function than the main function as an entrypoint.
Checklist
- [x] Linked to Github Issue
- [x] Unit tests added
- [x] Integration tests added.
Thank you for taking the time implementing a new feature. The team and I will review the RP
Hi @Bernardstanislas. Thanks for sending this feature. I'd suggest you add a test that proves the right entrypoint is called. It could simply be copy-pasting some of the examples with a renamed main function instead, or replacing in the JSON before use in memory.
Hi @Bernardstanislas. Thanks for sending this feature. I'd suggest you add a test that proves the right entrypoint is called. It could simply be copy-pasting some of the examples with a renamed
mainfunction instead, or replacing in the JSON before use in memory.
For sure, I'm a bit busy these days but I'm not forgetting this PR :)
For sure, I'm a bit busy these days but I'm not forgetting this PR :)
I've got a bit of time for this, would you like it if I made a PR against your branch with a test?
Hi @Bernardstanislas, I just sent you a PR against your branch with proposed changes.
Hi @Bernardstanislas, I just sent you a PR against your branch with proposed changes.
Thanks a lot, just merged your PR
Hmmm, it looks like I didn't include the test in the PR for some reason 🤦 It's nearly end of day for me, is it OK for you if I send a new one tomorrow?
Hi @Bernardstanislas. Did you find the time to look into the new PR I sent you? Sorry for not mentioning it here, I assumed you'd get notified by GitHub. Then I remembered those tend to be rather easy to miss (it happens to me a lot).
Hi @Bernardstanislas. Did you find the time to look into the new PR I sent you? Sorry for not mentioning it here, I assumed you'd get notified by GitHub. Then I remembered those tend to be rather easy to miss (it happens to me a lot).
Wow I'm really sorry @Oppen I did actually miss it. So if I understand correctly, you need to include the tests and we're good to go?
Wow I'm really sorry @Oppen I did actually miss it. So if I understand correctly, you need to include the tests and we're good to go?
Yes, it's included in the PR. I'm not sure if any new merge conflicts were introduced in the meantime tho, but I expect not.
@Oppen I am mot sure I understood correctly, do we need your rebase to be able to merge this PR? Do you need something on my side? Sorry for the seemingly misunderstanding.
Hi @Bernardstanislas! @Oppen is on vacation for a few weeks. What we need is for you to accept his PR with the tests into your PR. After that, there are conflicts to resolve with the main branch and we should be good to go. If you could look into solving the conflicts that would be awesome, since I don't know if we can do it for you on a timely manner.
Hi @Juan-M-V , I merged the PR on my branch and it is now up to date and rebased!
Perfect! I'll run the tests and talk with the rest of the team to merge your changes
Codecov Report
Merging #220 (0d0c62e) into main (b805afa) will decrease coverage by
0.01%. The diff coverage is92.30%.
@@ Coverage Diff @@
## main #220 +/- ##
==========================================
- Coverage 97.88% 97.87% -0.02%
==========================================
Files 44 44
Lines 11600 11619 +19
==========================================
+ Hits 11355 11372 +17
- Misses 245 247 +2
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/main.rs | 5.00% <0.00%> (-0.56%) |
:arrow_down: |
| src/cairo_run.rs | 86.06% <100.00%> (+1.24%) |
:arrow_up: |
| src/serde/deserialize_program.rs | 91.80% <100.00%> (+0.32%) |
:arrow_up: |
| src/types/program.rs | 100.00% <100.00%> (ø) |
|
| tests/bitwise_test.rs | 100.00% <100.00%> (ø) |
|
| tests/cairo_run_test.rs | 98.40% <100.00%> (ø) |
|
| tests/pedersen_test.rs | 100.00% <100.00%> (ø) |
|
| tests/struct_test.rs | 100.00% <100.00%> (ø) |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more