Skip to content

Ensure ability to use selector fn override #38

@antazoey

Description

@antazoey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions