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

fix: Extract aliased constants from identifiers #278

Merged
merged 4 commits into from
Sep 20, 2023
Merged

fix: Extract aliased constants from identifiers #278

merged 4 commits into from
Sep 20, 2023

Conversation

fmoletta
Copy link
Contributor

When constants are imported from other modules, they appear as an alias in the compiled json. As we didn't take them into account when creating the constants map, hints that imported aliased constants would fail. For example:

"starkware.cairo.common.cairo_keccak.keccak.BLOCK_SIZE": {
            "destination": "starkware.cairo.common.cairo_keccak.packed_keccak.BLOCK_SIZE",
            "type": "alias"
        },
        "starkware.cairo.common.cairo_keccak.packed_keccak.BLOCK_SIZE": {
            "type": "const",
            "value": 3
        },

Here the hint executed with access to scope starkware.cairo.common.cairo_keccak.keccak needs the alias in order to access the BLOCK_SIZE constant imported from starkware.cairo.common.cairo_keccak.packed_keccak

@fmoletta fmoletta marked this pull request as ready for review September 20, 2023 18:27
@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2023

Codecov Report

Merging #278 (ef175d1) into main (edaabf3) will increase coverage by 0.06%.
The diff coverage is 82.35%.

@@            Coverage Diff             @@
##             main     #278      +/-   ##
==========================================
+ Coverage   58.67%   58.73%   +0.06%     
==========================================
  Files          41       41              
  Lines        5249     5264      +15     
==========================================
+ Hits         3080     3092      +12     
- Misses       1911     1914       +3     
  Partials      258      258              
Files Changed Coverage Δ
pkg/parser/parser.go 57.89% <ø> (ø)
pkg/vm/program.go 35.18% <82.35%> (+17.23%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jrchatruc jrchatruc added this pull request to the merge queue Sep 20, 2023
Merged via the queue into main with commit 5cfe5fe Sep 20, 2023
@jrchatruc jrchatruc deleted the fix-const branch September 20, 2023 20:26
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.

4 participants