-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Issue
In the CallDecoder class if I do something like this :
**cd = hypersync.CallDecoder(["transfer(address,uint256)"])
cd.decode_inputs_sync(["0xa9059cbb..."])**
This throws an error :
- AttributeError: ... has no attribute 'decode_input_syncs'
- or TypeError: ... 'builtin_function_or_method' ... cannot be converted to 'Sequence'
The core issue in hypersync/init.py file :
async def decode_inputs(self, inputs: list[str]) -> list[list[DecodedSolValue]]:
"""Parse log and return decoded event. Returns None if topic0 not found."""
return await self.inner.decode_inputs(input)
def decode_inputs_sync(self, inputs: list[str]) -> list[list[DecodedSolValue]]:
"""Parse log and return decoded event. Returns None if topic0 not found."""
return self.inner.decode_input_syncs(input)
Bugs in that snippet:
- used input (builtin) instead of inputs
- used decode_input_syncs instead of decode_inputs_sync
Solution :
async def decode_inputs(self, inputs: list[str]) -> list[list[DecodedSolValue]]:
"""Decode ABI-encoded calldata strings; forwards to the Rust CallDecoder."""
return await self.inner.decode_inputs(inputs)
def decode_inputs_sync(self, inputs: list[str]) -> list[list[DecodedSolValue]]:
"""Decode ABI-encoded calldata strings; forwards to the Rust CallDecoder."""
return self.inner.decode_inputs_sync(inputs)
Here , what I fixed :
- async path forwards inputs to self.inner.decode_inputs(inputs)
- sync path forwards inputs to self.inner.decode_inputs_sync(inputs)
So the two earlier bugs are fixed there:
- no accidental use of builtin input
- no typo decode_input_syncs method name
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels