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

Dev: replace all *_div_rem by DivRem::div_rem #381

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

khaeljy
Copy link
Contributor

@khaeljy khaeljy commented Sep 27, 2023

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Resolves: #374

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

@khaeljy
Copy link
Contributor Author

khaeljy commented Sep 27, 2023

Cause of the DivRem trait signature which requires lhs and rhs to be of the same T type, I was unable to replace u512_safe_div_rem_by_u256 which is used here: crates/evm/src/instructions/stop_and_arithmetic_operations.cairo

The same applies to the i256_signed_div_rem function in crates/utils/src/i256.cairo, which takes a NonZero<u256> as its second argument, because it's not possible to have a NonZero<i256> since NonZero is a type defined in the compiler, not in Cairo ( thanks @enitrat ).

Copy link
Collaborator

@enitrat enitrat left a comment

Choose a reason for hiding this comment

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

lgtm

@enitrat enitrat added this pull request to the merge queue Oct 2, 2023
Merged via the queue into kkrt-labs:main with commit 317d1a5 Oct 2, 2023
3 checks passed
@khaeljy khaeljy deleted the khaeljy/issue374 branch October 2, 2023 04:58
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.

dev: replace all *_div_rem by DivRem::div_rem
2 participants