-
Notifications
You must be signed in to change notification settings - Fork 13
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
Feat: Add lessThanOrEqualAddress cairo hint #132
Feat: Add lessThanOrEqualAddress cairo hint #132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great :)
@renzobanegass For the integration test, you have to write a Cairo program in the This hint is used by the A simple program such as fn main() {
let mut span = array![1, 2, 3].span();
let _ = span.multi_pop_back::<2>();
} |
|
I pushed some changes, I couldn't compile the cairo programs because of the error I showed you before, I added two, one for the The unit tests are working. |
It looks like you haven't the Cairo Zero toolchain (cairo-lang 0.13.1) installed in your current python environment. Poetry facilitates the management of dependencies, you should have Poetry installed, installation guide here Then in the root of the project set a poetry env to use python3.10: Then you should be able to compile Cairo Zero files. |
Also, your typescript files are not formatted as expected. We're using Trunk, install the IDE extension if you're using VSCode or Neovim, otherwise install their CLI and run |
This comment was marked as outdated.
This comment was marked as outdated.
17227a8
to
a7aca56
Compare
I solved it, don't worry. I'll check the programs are working. |
You're using the You should use the the Cairo VM TS CLI command, check the README You can do For your program, something like this would execute it: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, just some details on the JSDoc :)
cairo_programs/cairo/hints/test_less_than_or_equal_address_pop_back.cairo
Outdated
Show resolved
Hide resolved
cairo_programs/cairo/hints/test_less_than_or_equal_address_pop_front.cairo
Outdated
Show resolved
Hide resolved
All done! |
4db92c6
to
c2fd248
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good
Closes #122
This pull request implements the TestLessThanOrEqualAddress hint as described in the issue. The hint checks whether the value at lhs (a relocatable address) is less than or equal to the value at rhs (another relocatable address) and stores the boolean result (0 or 1) at dst. I'll leave it as a draft for now as I didn't create the cairo integration test yet, I would like some help with that because I don't get how those programs work RN. And would like to get feedback over the implementation and the tests.
Changes Made