Skip to content

Commit

Permalink
Make withdrawals_root field optional, fix empty HTTP urls before re…
Browse files Browse the repository at this point in the history
…quest (#932)
  • Loading branch information
droserasprout authored Feb 5, 2024
1 parent a20ce53 commit bd19352
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic

- cli: Do not consider config as oneshot if `tezos.tzkt.head` index is present.
- codegen: Allow dots to be used in typenames indicating nested packages.
- evm.node: Make `withdrawals_root` field optional in `EvmNodeHeadData` model.
- http: Fixed crash on some datasource URLs.

### Performance

Expand Down
2 changes: 1 addition & 1 deletion src/dipdup/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ async def _request(
"""Wrapped aiohttp call with preconfigured headers and ratelimiting"""
metrics.inc(f'{self._alias}:requests_total', 1.0)
if not url:
url = self._path
url = self._path or '/'
elif url.startswith('http'):
url = url.replace(self._url, '').rstrip('/')
else:
Expand Down
4 changes: 2 additions & 2 deletions src/dipdup/models/evm_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class EvmNodeHeadData:
gas_used: int
timestamp: int
base_fee_per_gas: int
withdrawals_root: str
withdrawals_root: str | None
nonce: str
mix_hash: str

Expand All @@ -76,7 +76,7 @@ def from_json(cls, block_json: dict[str, Any]) -> 'EvmNodeHeadData':
gas_used=int(block_json['gasUsed'], 16),
timestamp=int(block_json['timestamp'], 16),
base_fee_per_gas=int(block_json['baseFeePerGas'], 16),
withdrawals_root=block_json['withdrawalsRoot'],
withdrawals_root=block_json.get('withdrawalsRoot', None),
nonce=block_json['nonce'],
mix_hash=block_json['mixHash'],
)
Expand Down

0 comments on commit bd19352

Please sign in to comment.