[Wallet] Bugfix/enable-funding-multiple-mints (#210)

* Fix bug where no additional mints can be funded

As soon as one mint is in the database, the new multimint selector only
considers this mint, even if the `MINT_` environment variables point to
a different one. This commit fixes it by explicitly adding the set mint
URL to the selector.

Additionally did some small cleanups.

* Move mint adding to higher-level function

* bypass selection at first time

* use contextx, more explicit

* remove whitespace

---------

Co-authored-by: xphade <18196286+xphade@users.noreply.github.com>
This commit is contained in:
callebtc
2023-05-13 19:49:37 +02:00
committed by GitHub
parent 4088ab2876
commit f3cf1c69c4
3 changed files with 5 additions and 5 deletions

View File

@@ -67,7 +67,7 @@ def cli(ctx: Context, host: str, walletname: str):
ctx.obj["HOST"], os.path.join(settings.cashu_dir, walletname), name=walletname
)
ctx.obj["WALLET"] = wallet
asyncio.run(init_wallet(wallet))
asyncio.run(init_wallet(ctx.obj["WALLET"]))
# MUTLIMINT: Select a wallet
# only if a command is one of a subset that needs to specify a mint host
@@ -75,7 +75,6 @@ def cli(ctx: Context, host: str, walletname: str):
if ctx.invoked_subcommand not in ["send", "invoice", "pay"] or host:
return
# else: we ask the user to select one
ctx.obj["WALLET"] = wallet # set a wallet for get_mint_wallet in the next step
ctx.obj["WALLET"] = asyncio.run(
get_mint_wallet(ctx)
) # select a specific wallet by CLI input