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

Modify DictManager's get_tracker() method #122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

entropidelic
Copy link

@entropidelic entropidelic commented Nov 3, 2022

This change will greately simplify our integration with the cairo-rs VM, since our API can't return objects of the type VmConstsReference.


This change is Reviewable

Copy link
Collaborator

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @entropidelic)

Copy link
Collaborator

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @entropidelic)

Copy link
Collaborator

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @entropidelic)


src/starkware/cairo/common/dict.py line 60 at r1 (raw file):

        Gets a dict tracker given the dict_ptr.
        """
        if isinstance(dict_ptr, VmConstsReference):

Can't you just add your object type here?

Code quote:

if isinstance(dict_ptr, VmConstsReference):

Copy link
Collaborator

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @entropidelic)

Copy link
Collaborator

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @entropidelic)


src/starkware/cairo/common/dict.py line 60 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

Can't you just add your object type here?

Actually, just test that the dict_ptr is not a RelocatableValue.

Suggestion:

        if not isinstance(dict_ptr, RelocatableValue):
            dict_ptr = dict_ptr.address_

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.

None yet

4 participants