We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ed55c91 commit 27b6931Copy full SHA for 27b6931
1 file changed
cdp/user_operation.py
@@ -41,6 +41,16 @@ def __repr__(self) -> str:
41
"""Return a string representation of the Status."""
42
return str(self)
43
44
+ def __eq__(self, other):
45
+ """Check if the status is equal to another object. Supports string comparison."""
46
+ if isinstance(other, str):
47
+ return self.value == other
48
+ return super().__eq__(other)
49
+
50
+ def __hash__(self):
51
+ """Return a hash value for the enum member to allow use as dictionary keys."""
52
+ return hash(self.name)
53
54
def __init__(self, model: UserOperationModel, smart_wallet_address: str) -> None:
55
"""Initialize the UserOperation class.
56
0 commit comments