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

Simplify `get_offset_value_reference` and add unit tests

Open tcoratger opened this issue 11 months ago • 1 comments

Simplify get_offset_value_reference and add unit tests

Description

  • The logical test on base_addr and offset to know if we should return null is implicitly already provided by the Relocatable addition in the last step of the get_offset_value_reference function, so that I don't think it's needed is as an overhead.
  • Two unit tests are added to test edge configurations.

Description of the pull request changes and motivation.

Checklist

  • [ ] Linked to Github Issue
  • [X] Unit tests added
  • [ ] Integration tests added.
  • [ ] This change requires new documentation.
    • [ ] Documentation has been added/updated.
    • [ ] CHANGELOG has been updated.

tcoratger avatar Mar 13 '24 15:03 tcoratger