Reinstate hex input in abi decode
This commit is contained in:
parent
e39b91d433
commit
8374d83045
@ -77,7 +77,7 @@ class ABIMethodEncoder(ABIContract):
|
||||
|
||||
|
||||
|
||||
class ABIContractDecoder:
|
||||
class ABIContractDecoder(ABIContract):
|
||||
|
||||
|
||||
def typ(self, v):
|
||||
@ -137,7 +137,8 @@ class ABIContractDecoder:
|
||||
m = getattr(self, self.types[i])
|
||||
s = self.contents[i]
|
||||
logg.debug('{} {} {} {} {}'.format(i, m, self.types[i], self.contents[i], s))
|
||||
r.append(m(s.hex()))
|
||||
#r.append(m(s.hex()))
|
||||
r.append(m(s))
|
||||
return r
|
||||
|
||||
|
||||
|
@ -117,7 +117,10 @@ def unpack_hex(tx_raw_bytes, chain_spec):
|
||||
|
||||
|
||||
def __unpack_raw(tx_raw_bytes, chain_id=1):
|
||||
d = rlp_decode(tx_raw_bytes)
|
||||
try:
|
||||
d = rlp_decode(tx_raw_bytes)
|
||||
except Exception as e:
|
||||
raise ValueError('RLP deserialization failed: {}'.format(e))
|
||||
|
||||
logg.debug('decoding using chain id {}'.format(str(chain_id)))
|
||||
|
||||
|
@ -23,15 +23,15 @@ class TestContractLog(EthTesterCase):
|
||||
n = 42
|
||||
topics = [
|
||||
s,
|
||||
n.to_bytes(32, byteorder='big'),
|
||||
n.to_bytes(32, byteorder='big').hex(),
|
||||
]
|
||||
data = [
|
||||
(b'\xee' * 32),
|
||||
(b'\xee' * 32).hex(),
|
||||
]
|
||||
dec.apply(topics, data)
|
||||
o = dec.decode()
|
||||
self.assertEqual(o[0], 42)
|
||||
self.assertEqual(o[1], data[0].hex())
|
||||
self.assertEqual(o[1], data[0])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user