Fix missing conflict resolution in eth-encode, non-0x address fallthrough in eth-info

This commit is contained in:
nolash
2021-10-25 09:57:31 +02:00
parent b51e5dc408
commit 31e75f60de
4 changed files with 21 additions and 6 deletions

View File

@@ -16,10 +16,12 @@ class CLIEncoder(ABIContractEncoder):
__re_uint = r'^([uU])[int]*([0-9]+)?$'
__re_bytes = r'^([bB])[ytes]*([0-9]+)?$'
__re_string = r'^([sS])[tring]*$'
__re_address = r'^([aA])[ddress]*?$'
__translations = [
'to_uint',
'to_bytes',
'to_string',
'to_address',
]
def __init__(self, signature=None):
@@ -58,6 +60,18 @@ class CLIEncoder(ABIContractEncoder):
return (s, a)
def to_address(self, typ):
s = None
a = None
m = re.match(self.__re_address, typ)
if m == None:
return None
s = 'ADDRESS'
a = getattr(ABIContractType, s)
return (s, a)
def to_string(self, typ):
m = re.match(self.__re_string, typ)
if m == None: