Skip to content

Commit f66e83d

Browse files
authored
Merge pull request #142 from Routstr/no-need-for-async
no need for async on get_proofs_per_mint_and_unit
2 parents 14e0f82 + 05b2731 commit f66e83d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

routstr/core/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ async def withdraw(
667667
wallet = await get_wallet(
668668
withdraw_request.mint_url or TRUSTED_MINTS[0], withdraw_request.unit
669669
)
670-
proofs = await get_proofs_per_mint_and_unit(
670+
proofs = get_proofs_per_mint_and_unit(
671671
wallet,
672672
withdraw_request.mint_url or TRUSTED_MINTS[0],
673673
withdraw_request.unit,

routstr/wallet.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ async def recieve_token(
4545
async def send(amount: int, unit: str, mint_url: str | None = None) -> tuple[int, str]:
4646
"""Internal send function - returns amount and serialized token"""
4747
wallet: Wallet = await get_wallet(mint_url or PRIMARY_MINT_URL, unit)
48-
proofs = await get_proofs_per_mint_and_unit(
49-
wallet, mint_url or PRIMARY_MINT_URL, unit
50-
)
48+
proofs = get_proofs_per_mint_and_unit(wallet, mint_url or PRIMARY_MINT_URL, unit)
5149

5250
send_proofs, _ = await wallet.select_to_send(
5351
proofs, amount, set_reserved=True, include_fees=False
@@ -168,7 +166,7 @@ async def get_wallet(mint_url: str, unit: str = "sat", load: bool = True) -> Wal
168166
return _wallets[id]
169167

170168

171-
async def get_proofs_per_mint_and_unit(
169+
def get_proofs_per_mint_and_unit(
172170
wallet: Wallet, mint_url: str, unit: str, not_reserved: bool = False
173171
) -> list[Proof]:
174172
valid_keyset_ids = [
@@ -228,7 +226,7 @@ async def fetch_balance(
228226
) -> BalanceDetail:
229227
try:
230228
wallet = await get_wallet(mint_url, unit)
231-
proofs = await get_proofs_per_mint_and_unit(
229+
proofs = get_proofs_per_mint_and_unit(
232230
wallet, mint_url, unit, not_reserved=True
233231
)
234232
proofs = await slow_filter_spend_proofs(proofs, wallet)
@@ -311,7 +309,7 @@ async def periodic_payout() -> None:
311309
for mint_url in TRUSTED_MINTS:
312310
for unit in ["sat", "msat"]:
313311
wallet = await get_wallet(mint_url, unit)
314-
proofs = await get_proofs_per_mint_and_unit(
312+
proofs = get_proofs_per_mint_and_unit(
315313
wallet, mint_url, unit, not_reserved=True
316314
)
317315
proofs = await slow_filter_spend_proofs(proofs, wallet)

0 commit comments

Comments
 (0)