Skip to content

DRY up common code in contract classes #3561

Closed
@fselmo

Description

@fselmo

Working on #3540, I noticed a lot of the code that was cleaned up there can ideally be removed from the contract.py and async_contract.py into base_contract.py since the code is nearly identical. The biggest issue I can see to resolve may be the typing, which is why this warrants a separate issue since it's out of the scope of that PR.

Investigate the following, and perhaps other cases:

  • refactor __call__() in ContractFunction (+ respective async code) to BaseContractFunction
  • refactor __getattr__(), __getitem__() and __iter__() in ContractEvents and ContractFunctions (+ respective async code) to BaseContractEvents and BaseContractFunctions, respectively.

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