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

feat: allow comparing Struct types with sequence types #1874

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

antazoey
Copy link
Member

What I did

fixes: #1451
Fixes: APE-979

How I did it

handle different types in Struct.__eq__

How to verify it

pick your poison:

    expected_dict = {"a": owner, "b": tx_hash}
    assert actual == expected_dict

    expected_tuple = (owner, tx_hash)
    assert actual == expected_tuple

    expected_list = [owner, tx_hash]
    assert actual == expected_list

    expected_struct = contract_instance.getStruct()
    assert actual == expected_struct

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@antazoey antazoey changed the title feat: struct comparision improvements feat: allow comparing Struct types with sequence types Jan 19, 2024
@antazoey antazoey merged commit 07c5163 into ApeWorX:main Jan 22, 2024
16 checks passed
@antazoey antazoey deleted the feat/struct-tuple-compare branch January 22, 2024 16:38
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.

Map solidity struct to python tuple [APE-979]
2 participants