From 5a0ecad6f1fe852d8597cee5716ad76f51297968 Mon Sep 17 00:00:00 2001 From: Shroominic Date: Thu, 21 Aug 2025 15:54:29 -0300 Subject: [PATCH 1/2] no need for async --- routstr/wallet.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/routstr/wallet.py b/routstr/wallet.py index 717539bd..b4253eb6 100644 --- a/routstr/wallet.py +++ b/routstr/wallet.py @@ -44,9 +44,7 @@ async def recieve_token( async def send(amount: int, unit: str, mint_url: str | None = None) -> tuple[int, str]: """Internal send function - returns amount and serialized token""" wallet: Wallet = await get_wallet(mint_url or PRIMARY_MINT_URL, unit) - proofs = await get_proofs_per_mint_and_unit( - wallet, mint_url or PRIMARY_MINT_URL, unit - ) + proofs = get_proofs_per_mint_and_unit(wallet, mint_url or PRIMARY_MINT_URL, unit) send_proofs, _ = await wallet.select_to_send( proofs, amount, set_reserved=True, include_fees=False @@ -161,7 +159,7 @@ async def get_wallet(mint_url: str, unit: str = "sat", load: bool = True) -> Wal return _wallets[id] -async def get_proofs_per_mint_and_unit( +def get_proofs_per_mint_and_unit( wallet: Wallet, mint_url: str, unit: str, not_reserved: bool = False ) -> list[Proof]: valid_keyset_ids = [ @@ -221,7 +219,7 @@ async def fetch_all_balances( ) -> BalanceDetail: try: wallet = await get_wallet(mint_url, unit) - proofs = await get_proofs_per_mint_and_unit( + proofs = get_proofs_per_mint_and_unit( wallet, mint_url, unit, not_reserved=True ) proofs = await slow_filter_spend_proofs(proofs, wallet) @@ -304,7 +302,7 @@ async def periodic_payout() -> None: for mint_url in TRUSTED_MINTS: for unit in ["sat", "msat"]: wallet = await get_wallet(mint_url, unit) - proofs = await get_proofs_per_mint_and_unit( + proofs = get_proofs_per_mint_and_unit( wallet, mint_url, unit, not_reserved=True ) proofs = await slow_filter_spend_proofs(proofs, wallet) From 05b27315eefe1759e4d014335ea24c55a6196e44 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 23 Aug 2025 16:22:33 +0000 Subject: [PATCH 2/2] Remove async from get_proofs_per_mint_and_unit call in withdraw function Co-authored-by: db2002dominic --- routstr/core/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routstr/core/admin.py b/routstr/core/admin.py index 1c993a6a..4bf6b00a 100644 --- a/routstr/core/admin.py +++ b/routstr/core/admin.py @@ -667,7 +667,7 @@ async def withdraw( wallet = await get_wallet( withdraw_request.mint_url or TRUSTED_MINTS[0], withdraw_request.unit ) - proofs = await get_proofs_per_mint_and_unit( + proofs = get_proofs_per_mint_and_unit( wallet, withdraw_request.mint_url or TRUSTED_MINTS[0], withdraw_request.unit,