keep-starknet-strange / satoru

Synthetics platform for Starknet, inspired by GMX v2 design.
https://book.satoru.run/
MIT License
110 stars 73 forks source link

Improve Error Messages and Update Semgrep Rules for CI #453

Closed ametel01 closed 1 year ago

ametel01 commented 1 year ago

Pull Request Type

Current Behaviour

The codebase currently employs unwrap() which leads to unclear error messages. Additionally, divisions in the code are not pre-validated, resulting in ambiguous errors. The CI's semgrep check uses an outdated or irrelevant rule set for the current version of Cairo.

Linked Issue: #427

New Behavior

Replaced unwrap() with expect() for more informative error messages. Added pre-checks for divisions to yield clearer error messages, specifying either the variable or function name involved. A revised semgrep rule set has been added to the .github directory, although CI integration is pending.

Breaking Changes

None

Additional Info

Next Steps: Update CI to use the new semgrep rules.