lambdaclass / cairo-vm

cairo-vm is a Rust implementation of the Cairo VM. Cairo (CPU Algebraic Intermediate Representation) is a programming language for writing provable programs, where one party can prove to another that a certain computation was executed correctly without the need for this party to re-execute the same program.
https://lambdaclass.github.io/cairo-vm
Apache License 2.0
518 stars 148 forks source link

feat: add cairo_run_program function that takes a Program as an arg #1496

Closed ElijahVlasov closed 11 months ago

ElijahVlasov commented 11 months ago

Add cairo_run_program function to cairo_runner.

Description

It seems convenient to have an API function that runs a cairo program from a Program struct, not a serialized JSON representation. For instance, in my use-case the program comes from a compressed binary representation, not from a json, so don't want to copy the content of cairo_run function in my project for that.

If this is useful for someone barring me please consider this tiny PR :)

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (006666e) 96.81% compared to head (bab376e) 96.81%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1496 +/- ## ======================================= Coverage 96.81% 96.81% ======================================= Files 96 96 Lines 39574 39581 +7 ======================================= + Hits 38315 38322 +7 Misses 1259 1259 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Oppen commented 11 months ago

Also, clippy is complaining about taking a reference to program, which is now already a reference.

ElijahVlasov commented 11 months ago

Also, clippy is complaining about taking a reference to program, which is now already a reference.

Should be fine now