Skip to content

Commit

Permalink
Fix #53: Handle the case where transaction.to is None
Browse files Browse the repository at this point in the history
  • Loading branch information
nalepae committed Jun 28, 2023
1 parent 8d49015 commit 920cd17
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion eth_validator_watcher/fee_recipient.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ def process_fee_recipient(
try:
*_, last_transaction = transactions

if expected_fee_recipient == last_transaction.to:
if (
last_transaction.to is not None
and expected_fee_recipient == last_transaction.to
):
# The last transaction is to the expected fee recipient
return
except ValueError:
Expand Down
3 changes: 2 additions & 1 deletion eth_validator_watcher/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Contains the models for the validator watcher."""

from enum import Enum
from typing import Optional

from pydantic import BaseModel

Expand Down Expand Up @@ -176,7 +177,7 @@ class EthGetBlockByHashRequest(BaseModel):
class ExecutionBlock(BaseModel):
class Result(BaseModel):
class Transaction(BaseModel):
to: str
to: Optional[str]

transactions: list[Transaction]

Expand Down

0 comments on commit 920cd17

Please sign in to comment.