cairo-vm
cairo-vm copied to clipboard
Simplify `get_offset_value_reference` and add unit tests
Simplify get_offset_value_reference
and add unit tests
Description
- The logical test on
base_addr
andoffset
to know if we should return null is implicitly already provided by the Relocatable addition in the last step of theget_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.