Skip to content

Type strings only for encode_single and decode_single #86

@davesque

Description

@davesque

What was wrong?

The encode_single and decode_single functions currently accept either a type string or a type tuple to identify the type that is being worked with. It seems preferable that a type string is all that should be accepted since type tuples are simple converted to type strings internally and an additional type check is performed on the input which could become costly if it ends up in a critical path.

How can it be fixed?

We should consider changing encode_single and decode_single to only accept type strings and also remove the collapse_type utility function. Since this function is extremely simple in nature, it can be manually copied to and used in whatever contexts it is still needed (such as in web3.py code).

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