Skip to content

Better error message if abi is not provided for contract #698

@pipermerriam

Description

@pipermerriam
  • Version: 3.x and 4.x

What was wrong?

In 3.x if no ABI is provided when instantiating a contract instance you would get an unhelpful error message as seen here: #696

In 4.x this type of error won't occur, however, the situation can still be approved because the contract.functions API simply won't have any accessible functions.

How can it be fixed?

I don't think we need to fix 3.x but we could provide a simple patch to raise a better error message if self.abi is None.

In 4.x I think that we can improve the situation. Maybe accessing contract.functions when abi is None should raise an exception that no contract ABI was provided (same for accessing contract.events).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions