chia-blockchain/chia/wallet/transaction_sorting.py
Kyle Altendorf 3b084a165b
configure isort to add the future annotations import (#13327)
* 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
2022-09-30 03:40:22 -05:00

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")