mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-20 08:05:33 +03:00
3b084a165b
* configure isort to add the future annotations import * apply the new isort setting * remove type ignores for new mypy (#13539) https://pypi.org/project/mypy/0.981/ * another
15 lines
415 B
Python
15 lines
415 B
Python
from __future__ import annotations
|
|
|
|
import enum
|
|
|
|
|
|
class SortKey(enum.Enum):
|
|
CONFIRMED_AT_HEIGHT = "ORDER BY confirmed_at_height {ASC}"
|
|
RELEVANCE = "ORDER BY confirmed {ASC}, confirmed_at_height {DESC}, created_at_time {DESC}"
|
|
|
|
def ascending(self) -> str:
|
|
return self.value.format(ASC="ASC", DESC="DESC")
|
|
|
|
def descending(self) -> str:
|
|
return self.value.format(ASC="DESC", DESC="ASC")
|