Skip to content

Commit

Permalink
Small Velvet fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Jan 1, 2025
1 parent e86365d commit cb26123
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion eth_defi/hotwallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def allocate_nonce(self) -> int:
Increase the nonce counter
"""
assert self.current_nonce is not None, "Nonce is not yet synced from the blockchain"
assert self.current_nonce is not None, f"Nonce is not yet synced from the blockchain: {self}"
nonce = self.current_nonce
self.current_nonce += 1
return nonce
Expand Down
2 changes: 1 addition & 1 deletion eth_defi/vault/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class VaultSpec:

def __post_init__(self):
assert isinstance(self.chain_id, int)
assert isinstance(self.vault_address, str)
assert isinstance(self.vault_address, str), f"Expected str, got {self.vault_address}"
assert self.vault_address.startswith("0x")


Expand Down
3 changes: 2 additions & 1 deletion eth_defi/velvet/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ def fetch_info(self) -> VelvetVaultInfo:
# url = f"https://api.velvet.capital/api/v3/portfolio/{self.spec.vault_address}"
url = f"https://eventsapi.velvetdao.xyz/api/v3/portfolio/{self.spec.vault_address}"
data = self.session.get(url).json()
if "error" in data:
if ("error" in data) or ("message" in data):
raise VelvetBadConfig(f"Velvet portfolio info failed: {data}")

return data["data"]

@cached_property
Expand Down

0 comments on commit cb26123

Please sign in to comment.