Skip to content

Commit

Permalink
chore: add detail to
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Dec 20, 2024
1 parent babdc81 commit dd97747
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions eth_portfolio/_loaders/token_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from async_lru import alru_cache
from dank_mids import BlockSemaphore
from evmspec.data import TransactionIndex
from msgspec import Struct
from msgspec import Struct, ValidationError
from msgspec.json import decode
from pony.orm import TransactionIntegrityError, UnexpectedError
from y import ERC20
Expand Down Expand Up @@ -200,9 +200,12 @@ async def get_transaction_index(hash: str) -> int:
break
logger.info("get_transaction_index failed, retrying...")

return decode(
receipt_bytes, type=HasTxIndex, dec_hook=TransactionIndex._decode_hook
).transactionIndex
try:
return decode(
receipt_bytes, type=HasTxIndex, dec_hook=TransactionIndex._decode_hook
).transactionIndex
except ValidationError as e:
raise TypeError(e, receipt_bytes, decode(receipt_bytes) from e


class HasTxIndex(Struct):
Expand Down

0 comments on commit dd97747

Please sign in to comment.