Fix missing conflict resolution in eth-encode, non-0x address fallthrough in eth-info
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user