Skip to content

Commit

Permalink
fix: td
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Aug 5, 2024
1 parent 2540370 commit d0c4da6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/ape/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@
cases.
"""


HexInt = Annotated[
int,
BeforeValidator(
lambda v, info: v if v is None else ManagerAccessMixin.conversion_manager.convert(v, int)
lambda v, info: None if v is None else ManagerAccessMixin.conversion_manager.convert(v, int)
),
]
"""
Expand Down
4 changes: 3 additions & 1 deletion src/ape_ethereum/ecosystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,9 @@ def decode_block(self, data: dict) -> BlockAPI:
if "transaction_ids" in data:
data["transactions"] = data.pop("transaction_ids")
if "total_difficulty" in data:
data["totalDifficulty"] = data.pop("total_difficulty")
data["totalDifficulty"] = data.pop("total_difficulty") or 0
elif "totalDifficulty" in data:
data["totalDifficulty"] = data.pop("totalDifficulty") or 0
if "base_fee" in data:
data["baseFeePerGas"] = data.pop("base_fee")
elif "baseFee" in data:
Expand Down

0 comments on commit d0c4da6

Please sign in to comment.