We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 81120e4 commit 238bdbbCopy full SHA for 238bdbb
1 file changed
onchain/tokens/metadata.py
@@ -4,12 +4,10 @@
4
from typing import Optional, List
5
import logging
6
import botocore
7
-from cachetools import TTLCache, LRUCache
+from cachetools import TTLCache, LRUCache, cached
8
from ratelimit import limits, sleep_and_retry
9
from ratelimit.exception import RateLimitException
10
import time
11
-from cachetools import cachedmethod
12
-
13
14
@dataclass
15
class TokenMetadata:
@@ -46,7 +44,7 @@ def __init__(self, tokens_table):
46
44
## Search token
47
45
##
48
49
- @cachedmethod(cache=TTLCache(maxsize=100_000, ttl=60 * 60))
+ @cached(cache=TTLCache(maxsize=100_000, ttl=60 * 60))
50
def search_token(self, token: str, chain: Optional[str]) -> Optional[TokenMetadata]:
51
"""Search for a token by name or symbol."""
52
# Check if token is a valid address
0 commit comments