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

safe_uint subtraction #669

Closed
codygunton opened this issue Aug 16, 2023 · 0 comments · Fixed by AztecProtocol/aztec-packages#2472
Closed

safe_uint subtraction #669

codygunton opened this issue Aug 16, 2023 · 0 comments · Fixed by AztecProtocol/aztec-packages#2472
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@codygunton
Copy link
Collaborator

codygunton commented Aug 16, 2023

The safe_uint method which is not tested correctly in SafeUintTest.TestSubtractMethodUnderflowFails.

@codygunton codygunton added bug Something isn't working good first issue Good for newcomers labels Aug 17, 2023
@lucasxia01 lucasxia01 self-assigned this Sep 18, 2023
@lucasxia01 lucasxia01 linked a pull request Sep 22, 2023 that will close this issue
2 tasks
lucasxia01 added a commit to AztecProtocol/aztec-packages that referenced this issue Sep 29, 2023
Motivated by AztecProtocol/barretenberg#669.

This PR updates the safe_uint tests, and adds more documentation to the
tests as well as the subtract and operator- class methods. In
more detail:

- it fixes TestMinusOperatorUnderflowFails (now named
TestMinusUnderflowGeneral1) to check for a failing
constraint through `EXPECT_FALSE(composer.check_circuit())` instead of
executing without checking anything.
- it adds new tests to test edge cases and different failure branches
where overflow/underflow occur in the operator+, operator*, subtract(),
and operator- methods.
- it adds detailed comments to the subtract() and operator- functions,
and the corresponding tests.
- it moves the subtract, operator-, divide, and operator/  implementations from the header file to the source file.

---------

Co-authored-by: maramihali <[email protected]>
AztecBot pushed a commit that referenced this issue Sep 30, 2023
Motivated by #669.

This PR updates the safe_uint tests, and adds more documentation to the
tests as well as the subtract and operator- class methods. In
more detail:

- it fixes TestMinusOperatorUnderflowFails (now named
TestMinusUnderflowGeneral1) to check for a failing
constraint through `EXPECT_FALSE(composer.check_circuit())` instead of
executing without checking anything.
- it adds new tests to test edge cases and different failure branches
where overflow/underflow occur in the operator+, operator*, subtract(),
and operator- methods.
- it adds detailed comments to the subtract() and operator- functions,
and the corresponding tests.
- it moves the subtract, operator-, divide, and operator/  implementations from the header file to the source file.

---------

Co-authored-by: maramihali <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants