fix: resolve linting and formatting issues for CI
- Use contextlib.suppress instead of try/except/pass (SIM105) - Prefix unused fixture arguments with underscore (ARG002) - Replace asyncio.TimeoutError with TimeoutError (UP041) - Apply ruff formatting to all files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
a15086688a
commit
1f4f1fa557
@@ -91,7 +91,9 @@ class WalletAnalyzer:
|
||||
return WalletProfile(
|
||||
address=data["address"],
|
||||
nonce=data["nonce"],
|
||||
first_seen=datetime.fromisoformat(data["first_seen"]) if data["first_seen"] else None,
|
||||
first_seen=datetime.fromisoformat(data["first_seen"])
|
||||
if data["first_seen"]
|
||||
else None,
|
||||
age_hours=data["age_hours"],
|
||||
is_fresh=data["is_fresh"],
|
||||
total_tx_count=data["total_tx_count"],
|
||||
|
||||
@@ -503,9 +503,7 @@ class PolygonClient:
|
||||
balance_task = self.get_balance(address)
|
||||
first_tx_task = self.get_first_transaction(address)
|
||||
|
||||
nonce, balance, first_tx = await asyncio.gather(
|
||||
nonce_task, balance_task, first_tx_task
|
||||
)
|
||||
nonce, balance, first_tx = await asyncio.gather(nonce_task, balance_task, first_tx_task)
|
||||
|
||||
return WalletInfo(
|
||||
address=address.lower(),
|
||||
|
||||
@@ -195,19 +195,16 @@ class EntityRegistry:
|
||||
True if the address is a known smart contract.
|
||||
"""
|
||||
entity_type = self.classify(address)
|
||||
contract_types = (
|
||||
self.DEX_ENTITY_TYPES
|
||||
| {
|
||||
EntityType.TOKEN_USDC,
|
||||
EntityType.TOKEN_USDT,
|
||||
EntityType.TOKEN_WETH,
|
||||
EntityType.TOKEN_WMATIC,
|
||||
EntityType.DEFI_AAVE,
|
||||
EntityType.DEFI_COMPOUND,
|
||||
EntityType.DEFI_OTHER,
|
||||
EntityType.CONTRACT,
|
||||
}
|
||||
)
|
||||
contract_types = self.DEX_ENTITY_TYPES | {
|
||||
EntityType.TOKEN_USDC,
|
||||
EntityType.TOKEN_USDT,
|
||||
EntityType.TOKEN_WETH,
|
||||
EntityType.TOKEN_WMATIC,
|
||||
EntityType.DEFI_AAVE,
|
||||
EntityType.DEFI_COMPOUND,
|
||||
EntityType.DEFI_OTHER,
|
||||
EntityType.CONTRACT,
|
||||
}
|
||||
return entity_type in contract_types
|
||||
|
||||
def get_entity_category(self, address: str) -> str:
|
||||
|
||||
@@ -58,7 +58,10 @@ class WalletInfo:
|
||||
"""Return wallet age in days based on first transaction."""
|
||||
if self.first_transaction is None:
|
||||
return None
|
||||
delta = datetime.now(tz=self.first_transaction.timestamp.tzinfo) - self.first_transaction.timestamp
|
||||
delta = (
|
||||
datetime.now(tz=self.first_transaction.timestamp.tzinfo)
|
||||
- self.first_transaction.timestamp
|
||||
)
|
||||
return delta.total_seconds() / 86400
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user