Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mvadari committed Sep 19, 2024
1 parent c745f69 commit 786ad8d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions xrpl/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,10 @@ def is_valid(self: Self) -> bool:
def _check_type(
self: Self, attr: str, value: Any, expected_type: Type[Any]
) -> Dict[str, str]:
# returns error dict if type is bad, None if type is good
"""
Returns error dictionary if the type of `value` does not match the
`expected_type`.
"""
expected_type_origin = get_origin(expected_type)
if expected_type_origin is Union:
if any(
Expand All @@ -311,7 +314,7 @@ def _check_type(
if expected_type_origin is list:
# expected a List, received a List
if not isinstance(value, list):
return {"attr": f"{attr} is {type(value)}, expected {expected_type}"}
return {attr: f"{attr} is {type(value)}, expected {expected_type}"}
result = {}
for i in range(len(value)):
result.update(
Expand Down

0 comments on commit 786ad8d

Please sign in to comment.