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

Add MathError for math operations #855

Merged
merged 27 commits into from
Mar 6, 2023
Merged

Add MathError for math operations #855

merged 27 commits into from
Mar 6, 2023

Conversation

fmoletta
Copy link
Member

@fmoletta fmoletta commented Feb 17, 2023

This PR aims to collect math-related errors scattered around VirtualMachineError & RunnerError into its own Error.
Errors related to: type conversions, functions on math.rs, relocatable & mayberelocatable operations have been moved to MathError

@codecov
Copy link

codecov bot commented Feb 23, 2023

Codecov Report

Merging #855 (6f0363b) into main (d5a7bea) will increase coverage by 0.05%.
The diff coverage is 97.72%.

@@            Coverage Diff             @@
##             main     #855      +/-   ##
==========================================
+ Coverage   96.84%   96.89%   +0.05%     
==========================================
  Files          69       69              
  Lines       28807    28801       -6     
==========================================
+ Hits        27897    27906       +9     
+ Misses        910      895      -15     
Impacted Files Coverage Δ
...processor/builtin_hint_processor/secp/signature.rs 98.67% <ø> (ø)
src/vm/runners/cairo_runner.rs 97.48% <50.00%> (-0.03%) ⬇️
src/hint_processor/hint_processor_utils.rs 88.88% <90.00%> (+0.04%) ⬆️
src/math_utils.rs 99.57% <92.85%> (+0.42%) ⬆️
src/vm/vm_core.rs 97.49% <94.11%> (-0.01%) ⬇️
src/types/relocatable.rs 99.66% <99.40%> (+2.26%) ⬆️
..._processor/builtin_hint_processor/blake2s_utils.rs 99.74% <100.00%> (+0.25%) ⬆️
...uiltin_hint_processor/cairo_keccak/keccak_hints.rs 93.91% <100.00%> (+0.02%) ⬆️
...rocessor/builtin_hint_processor/dict_hint_utils.rs 99.23% <100.00%> (-0.01%) ⬇️
...cessor/builtin_hint_processor/find_element_hint.rs 96.46% <100.00%> (ø)
... and 28 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@fmoletta fmoletta marked this pull request as ready for review February 23, 2023 15:18
Copy link
Contributor

@Jrigada Jrigada left a comment

Choose a reason for hiding this comment

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

I really like how you organized this change, looks great.

fmoletta and others added 2 commits March 1, 2023 16:18
* Catch possible overflows in Relocatable::add

* Move sub implementations to trait impl

* Swap sub_usize for - operator

* Vheck possible overflows in Add<i32>

* Fix should_panic test

* remove referenced add

* Replace Relocatable methods for trait implementations

* Catch overflows in mayberelocatable operations

* Fix keccak

* Clippy
@Oppen Oppen added this pull request to the merge queue Mar 6, 2023
Merged via the queue into main with commit 1de3e2b Mar 6, 2023
@Oppen Oppen deleted the math-error branch March 6, 2023 14:21
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.

3 participants