code cleanup

This commit is contained in:
Riccardo Balbo 2024-07-24 14:18:57 +00:00
commit 17f4bb7218
10 changed files with 35 additions and 73 deletions

View file

@ -22,11 +22,9 @@ class NWCKey(BaseModel):
try:
return cls.permissions.split(" ")
except:
# TODO: log error
return []
@classmethod
def from_row(cls, row: Dict[str, Any]) -> "NWCKey":
return cls(**row)
@ -51,7 +49,6 @@ class NWCBudget(BaseModel):
next_cycle = last_cycle + cls.refresh_window
return last_cycle, next_cycle
@classmethod
def from_row(cls, row: Row) -> "NWCBudget":
return cls(**dict(row))
@ -68,12 +65,12 @@ class NWCLog(BaseModel):
return cls(**dict(row))
class NWCNewBudget(BaseModel):
budget_msats: int
refresh_window: int
created_at: int
class NWCRegistrationRequest(BaseModel):
permissions: List[str]
description: str