Skip to content

Commit

Permalink
Fix the calculation of expiring governance alarm
Browse files Browse the repository at this point in the history
  • Loading branch information
mzebrak committed Feb 22, 2024
1 parent 991d8e5 commit 368b1b1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ def __check_for_recurrent_transfers(self, data: _AccountSanitizedData) -> bool:

def __check_is_governance_is_expiring(self, data: _AccountSanitizedData) -> bool:
warning_period_in_days: Final[int] = 31
return data.core.governance_vote_expiration_ts - timedelta(
days=warning_period_in_days
) > self.__normalize_datetime(datetime.utcnow())
expiration: datetime = data.core.governance_vote_expiration_ts
current_time = self.__normalize_datetime(datetime.utcnow())
return (expiration - current_time).days <= warning_period_in_days

def __get_account_reputation(self, data: Reputation | None) -> int:
return 0 if data is None else int(data.reputation)
Expand Down

0 comments on commit 368b1b1

Please sign in to comment.