Skip to content

Commit

Permalink
feat: adds protected prefix to __getitem__ check
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwise-constructs committed Dec 11, 2024
1 parent 3d0030c commit 31392b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eip712/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _types_(self) -> dict:
return types

def __getitem__(self, key: str) -> Any:
if (key.startswith("_") and key.endswith("_")) or key not in self.model_fields:
if (key.startswith("eip712_") and key.endswith("_")) or key not in self.model_fields:
raise KeyError("Cannot look up header fields or other attributes this way")

return getattr(self, key)
Expand Down

0 comments on commit 31392b5

Please sign in to comment.