diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 543f7e22..1651ec7e 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -113,7 +113,7 @@ class TestmintWallet: self.refund_history: List[Dict[str, Any]] = [] async def init(self) -> None: - """Initialize the sixty_nuts wallet""" + """Initialize the cashu wallet""" # In mock mode, we don't actually create a real wallet # This is just a placeholder for the mock implementation self.wallet = None @@ -518,7 +518,9 @@ async def integration_app( with ( patch("routstr.core.db.engine", integration_engine), patch.object(_settings, "cashu_mints", [mint_url]), - patch("routstr.payment.wallet.credit_balance", testmint_wallet.credit_balance), + patch( + "routstr.payment.wallet.credit_balance", testmint_wallet.credit_balance + ), patch("routstr.payment.wallet.send_token", testmint_wallet.send_token), patch("routstr.payment.wallet.recieve_token", testmint_wallet.redeem_token), patch("routstr.payment.wallet.get_balance", testmint_wallet.get_balance), diff --git a/tests/integration/real_testmint.py b/tests/integration/real_testmint.py index 2536f84d..84b2f542 100644 --- a/tests/integration/real_testmint.py +++ b/tests/integration/real_testmint.py @@ -1,18 +1,18 @@ """ Real Cashu mint integration for integration tests. -This module provides a real sixty_nuts Wallet implementation that can be used +This module provides a real cashu Wallet implementation that can be used with an actual Cashu mint instance for more thorough integration testing. """ import os from typing import Optional, Tuple -from sixty_nuts import Wallet +from cashu.wallet.wallet import Wallet class RealMintWallet: - """Real Cashu mint wallet using sixty_nuts library""" + """Real Cashu mint wallet using cashu library""" def __init__(self, mint_url: str, nsec: str): self.mint_url = mint_url @@ -22,7 +22,12 @@ class RealMintWallet: async def init(self) -> None: """Initialize the wallet connection""" if not self._wallet: - self._wallet = await Wallet.create(nsec=self.nsec) + self._wallet = await Wallet.with_db( + self.mint_url, + db="sqlite+aiosqlite:///:memory:", + load_all_keysets=True, + unit="sat", + ) @property def wallet(self) -> Wallet: diff --git a/tests/integration/test_real_mint.py b/tests/integration/test_real_mint.py index 9e48bf84..8e23d830 100644 --- a/tests/integration/test_real_mint.py +++ b/tests/integration/test_real_mint.py @@ -9,7 +9,7 @@ import os try: from .real_testmint import create_real_mint_wallet except ImportError: - # sixty_nuts not available, tests will be skipped + # cashu not available, tests will be skipped create_real_mint_wallet = None # type: ignore @@ -17,9 +17,9 @@ async def test_real_wallet() -> None: """Test basic operations with a real Cashu mint wallet""" print("Testing real Cashu mint wallet...") - # Check if sixty_nuts dependency is available + # Check if cashu dependency is available if create_real_mint_wallet is None: - print("sixty_nuts not available. Skipping real mint tests.") + print("cashu not available. Skipping real mint tests.") return # Check if real mint is enabled