Merge pull request #142 from Routstr/no-need-for-async

no need for async on get_proofs_per_mint_and_unit
This commit is contained in:
shroominic
2025-08-23 17:18:41 -03:00
committed by GitHub
2 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -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,
+4 -6
View File
@@ -45,9 +45,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
@@ -168,7 +166,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 = [
@@ -228,7 +226,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)
@@ -311,7 +309,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)