Skip to content

Commit

Permalink
remove statuses from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Nov 16, 2023
1 parent 29ff9b1 commit cdbe3a4
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 22 deletions.
6 changes: 2 additions & 4 deletions cashu/mint/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ async def start_mint_init():
status = await ledger.lightning.status()
if status.error_message:
logger.warning(
(
f"The backend for {ledger.lightning.__class__.__name__} isn't"
f" working properly: '{status.error_message}'"
),
f"The backend for {ledger.lightning.__class__.__name__} isn't"
f" working properly: '{status.error_message}'",
RuntimeWarning,
)
logger.info(f"Lightning balance: {status.balance_msat} msat")
Expand Down
9 changes: 3 additions & 6 deletions cashu/wallet/api/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,9 @@ async def burn(
wallet = await mint_wallet(mint)
if not (all or token or force or delete) or (token and all):
raise Exception(
(
"enter a token or use --all to burn all pending tokens, --force to"
" check all tokens or --delete with send ID to force-delete pending"
" token from list if mint is unavailable."
),
"enter a token or use --all to burn all pending tokens, --force to"
" check all tokens or --delete with send ID to force-delete pending"
" token from list if mint is unavailable.",
)
if all:
# check only those who are flagged as reserved
Expand Down Expand Up @@ -440,7 +438,6 @@ async def restore(
await wallet.load_mint()
await wallet.restore_promises_from_to(0, to)
await wallet.invalidate(wallet.proofs)
wallet.status()
return RestoreResponse(balance=wallet.available_balance)


Expand Down
3 changes: 3 additions & 0 deletions cashu/wallet/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ async def send_command(
await send_nostr(
wallet, amount=amount, pubkey=nostr or nopt, verbose=verbose, yes=yes
)
print_balance(ctx)


@cli.command("receive", help="Receive tokens.")
Expand Down Expand Up @@ -497,6 +498,8 @@ async def receive_cli(
await receive(wallet, tokenObj)
else:
print("Error: enter token or use either flag --nostr or --all.")
return
print_balance(ctx)


@cli.command("burn", help="Burn spent tokens.")
Expand Down
1 change: 0 additions & 1 deletion tests/test_mint_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ async def wallet1(mint):
name="wallet1",
)
await wallet1.load_mint()
wallet1.status()
yield wallet1


Expand Down
3 changes: 0 additions & 3 deletions tests/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ async def wallet1(mint):
name="wallet1",
)
await wallet1.load_mint()
wallet1.status()
yield wallet1


Expand All @@ -67,7 +66,6 @@ async def wallet2(mint):
name="wallet2",
)
await wallet2.load_mint()
wallet2.status()
yield wallet2


Expand All @@ -85,7 +83,6 @@ async def wallet3(mint):
await wallet3.db.execute("DELETE FROM proofs")
await wallet3.db.execute("DELETE FROM proofs_used")
await wallet3.load_mint()
wallet3.status()
yield wallet3


Expand Down
1 change: 0 additions & 1 deletion tests/test_wallet_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ async def wallet(mint):
name="wallet",
)
await wallet.load_mint()
wallet.status()
yield wallet


Expand Down
2 changes: 0 additions & 2 deletions tests/test_wallet_htlc.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ async def wallet1(mint):
)
await migrate_databases(wallet1.db, migrations)
await wallet1.load_mint()
wallet1.status()
yield wallet1


Expand All @@ -53,7 +52,6 @@ async def wallet2(mint):
await migrate_databases(wallet2.db, migrations)
wallet2.private_key = PrivateKey(secrets.token_bytes(32), raw=True)
await wallet2.load_mint()
wallet2.status()
yield wallet2


Expand Down
2 changes: 0 additions & 2 deletions tests/test_wallet_p2pk.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ async def wallet1(mint):
)
await migrate_databases(wallet1.db, migrations)
await wallet1.load_mint()
wallet1.status()
yield wallet1


Expand All @@ -54,7 +53,6 @@ async def wallet2(mint):
await migrate_databases(wallet2.db, migrations)
wallet2.private_key = PrivateKey(secrets.token_bytes(32), raw=True)
await wallet2.load_mint()
wallet2.status()
yield wallet2


Expand Down
3 changes: 0 additions & 3 deletions tests/test_wallet_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ async def wallet1(mint):
name="wallet1",
)
await wallet1.load_mint()
wallet1.status()
yield wallet1


Expand All @@ -65,7 +64,6 @@ async def wallet2(mint):
name="wallet2",
)
await wallet2.load_mint()
wallet2.status()
yield wallet2


Expand All @@ -83,7 +81,6 @@ async def wallet3(mint):
await wallet3.db.execute("DELETE FROM proofs")
await wallet3.db.execute("DELETE FROM proofs_used")
await wallet3.load_mint()
wallet3.status()
yield wallet3


Expand Down

0 comments on commit cdbe3a4

Please sign in to comment.