Skip to content

Commit

Permalink
fix: token sort order
Browse files Browse the repository at this point in the history
  • Loading branch information
v1nvn committed Oct 16, 2024
1 parent d3881af commit c84e073
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions models/credmark/tokens/nft/nft.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
from credmark.cmf.model.errors import ModelInputError
from credmark.cmf.types import Address, Contract, JoinType, Token
from credmark.dto import DTO, DTOField
from web3.exceptions import ABIFunctionNotFound, BadFunctionCallOutput, ContractLogicError
from web3.exceptions import (ABIFunctionNotFound, BadFunctionCallOutput,
ContractLogicError)

AZUKI_NFT = "0xED5AF388653567Af2F388E6224dC7C4b3241C544"
RTFKT_MNLTH_NFT = "0x86825dFCa7A6224cfBd2DA48e85DF2fc3Aa7C4B1"
Expand Down Expand Up @@ -379,7 +380,7 @@ def run(self, input: NFTHolderInput) -> NFTHoldersOutput:
elif input.order_by == "oldest":
order_by = q.field("first_block_number").dquote().asc()
elif input.order_by == "most_tokens":
order_by = q.field("balance").dquote().asc()
order_by = q.field("balance").dquote().desc()
elif input.order_by == "least_tokens":
order_by = q.field("balance").dquote().asc()
else:
Expand Down
2 changes: 1 addition & 1 deletion models/credmark/tokens/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ def run(self, input: TokenHolderInput) -> TokenHoldersOutput:
elif input.order_by == "most_tokens":
order_by = q.field("balance").dquote().desc()
elif input.order_by == "least_tokens":
order_by = q.field("balance").dquote().desc()
order_by = q.field("balance").dquote().asc()
else:
raise ModelInputError("Invalid order by")

Expand Down

0 comments on commit c84e073

Please sign in to comment.