diff --git a/cashu/lightning/fake.py b/cashu/lightning/fake.py index dfeed100..d2c617a5 100644 --- a/cashu/lightning/fake.py +++ b/cashu/lightning/fake.py @@ -77,6 +77,7 @@ async def create_invoice( async def pay_invoice(self, bolt11: str, fee_limit_msat: int) -> PaymentResponse: invoice = decode(bolt11) + # await asyncio.sleep(5) if invoice.payment_hash[:6] == self.privkey[:6] or BRR: await self.queue.put(invoice) @@ -88,6 +89,8 @@ async def pay_invoice(self, bolt11: str, fee_limit_msat: int) -> PaymentResponse ) async def get_invoice_status(self, checking_id: str) -> PaymentStatus: + # paid = random.random() > 0.7 + # return PaymentStatus(paid) paid = checking_id in self.paid_invoices or BRR return PaymentStatus(paid or None) diff --git a/tests/test_mint_operations.py b/tests/test_mint_operations.py index c8e8606c..916d8f56 100644 --- a/tests/test_mint_operations.py +++ b/tests/test_mint_operations.py @@ -38,7 +38,6 @@ async def test_melt(wallet1: Wallet, ledger: Ledger): @pytest.mark.asyncio async def test_split(wallet1: Wallet, ledger: Ledger): - # mint twice so we have enough to pay the second invoice back invoice = await wallet1.request_mint(64) await wallet1.mint(64, hash=invoice.hash) @@ -55,15 +54,10 @@ async def test_split(wallet1: Wallet, ledger: Ledger): @pytest.mark.asyncio async def test_check_proof_state(wallet1: Wallet, ledger: Ledger): - # mint twice so we have enough to pay the second invoice back invoice = await wallet1.request_mint(64) await wallet1.mint(64, hash=invoice.hash) keep_proofs, send_proofs = await wallet1.split_to_send(wallet1.proofs, 10) - secrets, rs, derivation_paths = await wallet1.generate_n_secrets(len(send_proofs)) - outputs, rs = wallet1._construct_outputs( - [p.amount for p in send_proofs], secrets, rs - ) spendable, pending = await ledger.check_proof_state(proofs=send_proofs) assert sum(spendable) == len(send_proofs) diff --git a/tests/test_wallet_p2pk.py b/tests/test_wallet_p2pk.py index feade986..7a27f9f5 100644 --- a/tests/test_wallet_p2pk.py +++ b/tests/test_wallet_p2pk.py @@ -376,11 +376,8 @@ async def test_secret_initialized_with_tags(wallet1: Wallet): pubkey=pubkey.serialize().hex(), tags=tags, ) - assert secret.locktime assert secret.locktime == 100 - assert secret.n_sigs assert secret.n_sigs == 3 - assert secret.sigflag assert secret.sigflag == SigFlags.SIG_ALL @@ -396,7 +393,5 @@ async def test_secret_initialized_with_arguments(wallet1: Wallet): ) assert secret.locktime assert secret.locktime > 1689000000 - assert secret.n_sigs assert secret.n_sigs == 3 - assert secret.sigflag assert secret.sigflag == SigFlags.SIG_ALL