ApeWorX / ethpm-types

Implementation of EIP-2678
Apache License 2.0
14 stars 8 forks source link

refactor: use our own hexbytes [APE-730] #66

Closed antazoey closed 1 year ago

antazoey commented 1 year ago

What I did

noticed we were not using our own hexbytes class for contract bytescode. seems like we can? shouldnt be a breaking change since the classes are supposed to be the same, unless it breaks someone isinstance check ... hmmmm.

How I did it

How to verify it

Checklist

antazoey commented 1 year ago

I don't think the isinstance check would actually fail with a re-import

You are correct, I just tried:

In [1]: from hexbytes import HexBytes

In [2]: from ethpm_types import HexBytes as EthPMHexBytes

...

In [6]: b2 = EthPMHexBytes(0)

In [7]: isinstance(b2, HexBytes)
Out[7]: True

So if they had isinstance(b2, HexBytes) before, it will still work when we switch to our new type. It doesn't work in reverse, but that isn't surprising.