Skip to content

Add ability to determine the inner type of an array ABIType [APE-678] #63

@fubuloubu

Description

@fubuloubu

Overview

It's often a little difficult working with ABIType instances of arrays. It would be nice to have some better tools.

Specification

class ABIType(...):
    ...

    def is_array(self) -> bool:
        # check if `self.type` is something like `...[]` or `...[...]`

    def array_type(self) -> Optional["ABIType"]:
        if self.is_array():
            # fetch the "inner type" of the array, if it is an array type

Dependencies

Would be helpful for ApeWorX/ape#1319

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions