add is_valid method to RelayMessageType class

This commit is contained in:
jeffthibault
2022-08-01 19:45:56 -04:00
parent d475f0c483
commit c22917d076

View File

@@ -8,3 +8,8 @@ class RelayMessageType:
NOTICE = "NOTICE"
END_OF_STORED_EVENTS = "EOSE"
@staticmethod
def is_valid(type: str) -> bool:
if type == RelayMessageType.EVENT or type == RelayMessageType.NOTICE or type == RelayMessageType.END_OF_STORED_EVENTS:
return True
return False