Skip to content

Commit

Permalink
chore: fix sourcery errs (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Nov 9, 2024
1 parent f05d17e commit 91ebe16
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions eth_portfolio/_db/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ def get_block(block: int) -> entities.BlockExtended:
for trace in traces:
insert_trace(trace)
except Exception as e:
raise e.__class__(
e.args = (
"This is really bad. Might need to nuke your db if you value your logs/traces",
*e.args,
)
raise
for token, price in prices:
_set_price(token, price, sync=True)
asdasd = get_chain(sync=True)
Expand Down Expand Up @@ -186,8 +187,7 @@ def get_address(address: str) -> entities.AddressExtended:
entity.delete()
commit()
"""
entity = entities.Address.get(chain=chain.id, address=address)
if entity:
if entity := entities.Address.get(chain=chain.id, address=address):
return entity

ensure_chain()
Expand Down Expand Up @@ -495,4 +495,4 @@ def enc_hook(obj: Any) -> Any:
except TypeError:
if type(obj) is Decimal:
return obj.jsonify()
raise TypeError(type(obj), obj)
raise TypeError(type(obj), obj) from None

0 comments on commit 91ebe16

Please sign in to comment.