Skip to content

Commit 082c80c

Browse files
committed
Fix some issues
- Fix `has_contract_fallback_function`: it always returned `True` - Fix ERC721 sorting. Q2 could be `NULL` due to the `LEFT JOIN` - Fix a comment
1 parent 60727f8 commit 082c80c

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

safe_transaction_service/contracts/tx_decoder.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -575,11 +575,7 @@ def has_contract_fallback_function(self, address: ChecksumAddress) -> bool:
575575
abi = self.get_contract_abi(address)
576576
if not abi:
577577
return False
578-
return bool(
579-
dict(fn_abi, name="fallback")
580-
for fn_abi in abi
581-
if fn_abi.get("type") == "fallback"
582-
)
578+
return any(fn_abi.get("type") == "fallback" for fn_abi in abi)
583579

584580
@cachedmethod(
585581
cache=operator.attrgetter(

safe_transaction_service/history/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ def erc721_owned_by(
750750
owned_by_query += " AND Q1.address NOT IN (SELECT address FROM tokens_token WHERE spam = TRUE)"
751751

752752
# Sort by token `address`, then by `token_id` to be stable
753-
owned_by_query += " ORDER BY Q1.address, Q2.token_id"
753+
owned_by_query += " ORDER BY Q1.address, Q1.token_id"
754754

755755
with connection.cursor() as cursor:
756756
hex_address = HexBytes(address)

safe_transaction_service/history/services/balance_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(self, ethereum_client: EthereumClient, redis: Redis):
8383
self.redis = redis
8484
self.cache_token_info = TTLCache(
8585
maxsize=4096, ttl=60 * 30
86-
) # 2 hours of caching
86+
) # 30 minutes of caching
8787

8888
def _filter_tokens(
8989
self,

0 commit comments

Comments
 (0)