Skip to content

Commit

Permalink
change exception name & use typing
Browse files Browse the repository at this point in the history
  • Loading branch information
kgarbacinski committed Feb 26, 2024
1 parent fdaee33 commit 637cd66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions backend/app/context/epoch_details.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from datetime import datetime
from typing import List
from typing import List, Tuple

from app.context.epoch_state import EpochState
from app.context.helpers import check_if_future
from app.exceptions import WrongBlocksRange
from app.exceptions import InvalidBlocksRange
from app.extensions import epochs
from app.infrastructure import graphql
from app.infrastructure.external_api.etherscan.blocks import get_block_num_from_ts
Expand Down Expand Up @@ -48,7 +48,7 @@ def __init__(
self.block_rewards = None

@property
def duration_range(self) -> tuple[int, int]:
def duration_range(self) -> Tuple[int, int]:
return self.start_sec, self.end_sec

@property
Expand All @@ -57,7 +57,7 @@ def no_blocks(self):
Returns the number of blocks within [start_block, end_block) in the epoch.
"""
if not self.end_block or not self.start_block:
raise WrongBlocksRange
raise InvalidBlocksRange
return self.end_block - self.start_block


Expand Down
2 changes: 1 addition & 1 deletion backend/app/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def __init__(self):
super().__init__(self.description, self.code)


class WrongBlocksRange(OctantException):
class InvalidBlocksRange(OctantException):
code = 400
description = "Attempt to use wrong range of start and end block in epoch"

Expand Down

0 comments on commit 637cd66

Please sign in to comment.