cairo-vm icon indicating copy to clipboard operation
cairo-vm copied to clipboard

Add CLI option to specify entrypoint

Open Bernardstanislas opened this issue 3 years ago • 15 comments

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.

Bernardstanislas avatar Jun 30 '22 21:06 Bernardstanislas

Thank you for taking the time implementing a new feature. The team and I will review the RP

Juan-M-V avatar Jul 01 '22 13:07 Juan-M-V

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.

Oppen avatar Jul 01 '22 14:07 Oppen

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.

For sure, I'm a bit busy these days but I'm not forgetting this PR :)

Bernardstanislas avatar Jul 07 '22 14:07 Bernardstanislas

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?

Oppen avatar Jul 12 '22 14:07 Oppen

Hi @Bernardstanislas, I just sent you a PR against your branch with proposed changes.

Oppen avatar Jul 13 '22 18:07 Oppen

Hi @Bernardstanislas, I just sent you a PR against your branch with proposed changes.

Thanks a lot, just merged your PR

Bernardstanislas avatar Jul 13 '22 19:07 Bernardstanislas

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?

Oppen avatar Jul 13 '22 20:07 Oppen

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).

Oppen avatar Jul 25 '22 14:07 Oppen

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?

Bernardstanislas avatar Jul 25 '22 16:07 Bernardstanislas

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 avatar Jul 25 '22 22:07 Oppen

@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.

Bernardstanislas avatar Aug 11 '22 15:08 Bernardstanislas

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.

Juan-M-V avatar Aug 12 '22 13:08 Juan-M-V

Hi @Juan-M-V , I merged the PR on my branch and it is now up to date and rebased!

Bernardstanislas avatar Aug 14 '22 21:08 Bernardstanislas

Perfect! I'll run the tests and talk with the rest of the team to merge your changes

Juan-M-V avatar Aug 16 '22 12:08 Juan-M-V

Codecov Report

Merging #220 (0d0c62e) into main (b805afa) will decrease coverage by 0.01%. The diff coverage is 92.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

codecov-commenter avatar Aug 16 '22 12:08 codecov-commenter