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

Ensure ability to use selector fn override #38

Open
antazoey opened this issue Jun 18, 2022 · 0 comments
Open

Ensure ability to use selector fn override #38

antazoey opened this issue Jun 18, 2022 · 0 comments

Comments

@antazoey
Copy link
Member

Overview

I tried to use the selector_fn override but struggled in the case of Starknet which uses longer, int-based selectors.
I think the problem is with the int type so my suggestion for ethpm-types is to make a good test case of switching the selector fn to Starknet style and using it. I know work needs to be done here but not 100% sure what it is but making this ticket as a reminder to do it!

Specification

class CustomContractType(ContracType):
  _selector_fn = <some-int-hash-based-look-up>

def test_custom_int_selectors(contract_dict):
   contract_type = ContractType.parse_obj(contract_dict)
   actual = contract_type.mutable_methods[32451345]
   expected = contract_type.MyExpectedMethod
   assert actual == expected

Dependencies

Include links to any open issues that must be resolved before this feature can be implemented.

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

No branches or pull requests

1 participant