Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/opengradient/client/opg_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def ensure_opg_approval(
raise ValueError(f"Wallet {owner} has no OPG tokens. Fund the wallet before approving.")
elif min_base > balance:
raise ValueError(
f"Wallet {owner} has less OPG tokens than the minimum allowance ({min_base} < {balance}). "
f"Fund the wallet with at least {min_base / 10**18} OPG before approving."
f"Wallet {owner} has insufficient OPG balance: has {balance / 10**18:.6f} OPG, "
f"but the minimum required is {min_base / 10**18:.6f} OPG. Fund the wallet before approving."
)
elif approve_base > balance:
logger.warning(
Expand All @@ -222,3 +222,4 @@ def ensure_opg_approval(
approve_base,
)
return _send_approve_tx(wallet_account, w3, token, owner, spender, approve_base)

Loading