Skip to content

Commit

Permalink
remove benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Nov 24, 2023
1 parent 26927f5 commit 08d9c0c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
1 change: 1 addition & 0 deletions cashu/wallet/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ async def wrapper(self, *args, **kwargs):
proxies=proxies_dict, # type: ignore
headers=headers_dict,
base_url=self.url,
timeout=None if settings.debug else 5,
)
return await func(self, *args, **kwargs)

Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
SERVER_PORT = 3337
SERVER_ENDPOINT = f"http://localhost:{SERVER_PORT}"

settings.debug = True
settings.cashu_dir = "./test_data/"
settings.mint_host = "localhost"
settings.mint_port = SERVER_PORT
Expand Down
17 changes: 0 additions & 17 deletions tests/test_mint_operations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import time

import pytest
import pytest_asyncio

Expand Down Expand Up @@ -71,18 +69,3 @@ async def test_check_proof_state(wallet1: Wallet, ledger: Ledger):
spendable, pending = await ledger.check_proof_state(proofs=send_proofs)
assert sum(spendable) == len(send_proofs)
assert sum(pending) == 0


@pytest.mark.asyncio
async def test_benchmark_check_proof_spendable(wallet1: Wallet, ledger: Ledger):
invoice = await wallet1.request_mint(1000)
pay_if_regtest(invoice.bolt11)
await wallet1.mint(1000, split=[1] * 1000, id=invoice.id)

time_begin = time.time()
spendable = await ledger._check_proofs_spendable(wallet1.proofs)
time_end = time.time()
time_elapsed = time_end - time_begin
print(f"Time elapsed: {time_elapsed}")
assert sum(spendable) == len(wallet1.proofs)
assert time_elapsed < 0.5

0 comments on commit 08d9c0c

Please sign in to comment.