mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 18:44:20 +01:00
make format (#139)
This commit is contained in:
@@ -396,7 +396,9 @@ async def receive(ctx: Context, token: str, lock: str):
|
|||||||
@click.option(
|
@click.option(
|
||||||
"--nostr", "-n", default=False, is_flag=True, help="Receive tokens via nostr."
|
"--nostr", "-n", default=False, is_flag=True, help="Receive tokens via nostr."
|
||||||
)
|
)
|
||||||
@click.option("--all", "-a", default=False, is_flag=True, help="Receive all pending tokens.")
|
@click.option(
|
||||||
|
"--all", "-a", default=False, is_flag=True, help="Receive all pending tokens."
|
||||||
|
)
|
||||||
@click.option(
|
@click.option(
|
||||||
"--verbose",
|
"--verbose",
|
||||||
"-v",
|
"-v",
|
||||||
@@ -407,7 +409,9 @@ async def receive(ctx: Context, token: str, lock: str):
|
|||||||
)
|
)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
@coro
|
@coro
|
||||||
async def receive_cli(ctx: Context, token: str, lock: str, nostr: bool, all: bool, verbose: bool):
|
async def receive_cli(
|
||||||
|
ctx: Context, token: str, lock: str, nostr: bool, all: bool, verbose: bool
|
||||||
|
):
|
||||||
wallet: Wallet = ctx.obj["WALLET"]
|
wallet: Wallet = ctx.obj["WALLET"]
|
||||||
wallet.status()
|
wallet.status()
|
||||||
if token:
|
if token:
|
||||||
@@ -464,8 +468,15 @@ async def burn(ctx: Context, token: str, all: bool, force: bool):
|
|||||||
help="Print legacy token without mint information.",
|
help="Print legacy token without mint information.",
|
||||||
type=bool,
|
type=bool,
|
||||||
)
|
)
|
||||||
@click.option("--number", "-n", default=None, help='Show only n pending tokens.', type=int)
|
@click.option(
|
||||||
@click.option("--offset", default=0, help='Show pending tokens only starting from offset.', type=int)
|
"--number", "-n", default=None, help="Show only n pending tokens.", type=int
|
||||||
|
)
|
||||||
|
@click.option(
|
||||||
|
"--offset",
|
||||||
|
default=0,
|
||||||
|
help="Show pending tokens only starting from offset.",
|
||||||
|
type=int,
|
||||||
|
)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
@coro
|
@coro
|
||||||
async def pending(ctx: Context, legacy, number: int, offset: int):
|
async def pending(ctx: Context, legacy, number: int, offset: int):
|
||||||
@@ -476,8 +487,15 @@ async def pending(ctx: Context, legacy, number: int, offset: int):
|
|||||||
sorted_proofs = sorted(reserved_proofs, key=itemgetter("send_id")) # type: ignore
|
sorted_proofs = sorted(reserved_proofs, key=itemgetter("send_id")) # type: ignore
|
||||||
if number:
|
if number:
|
||||||
number += offset
|
number += offset
|
||||||
for i, (key, value) in islice(enumerate(
|
for i, (key, value) in islice(
|
||||||
groupby(sorted_proofs, key=itemgetter("send_id"),)), offset, number
|
enumerate(
|
||||||
|
groupby(
|
||||||
|
sorted_proofs,
|
||||||
|
key=itemgetter("send_id"),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
offset,
|
||||||
|
number,
|
||||||
):
|
):
|
||||||
grouped_proofs = list(value)
|
grouped_proofs = list(value)
|
||||||
token = await wallet.serialize_proofs(grouped_proofs)
|
token = await wallet.serialize_proofs(grouped_proofs)
|
||||||
|
|||||||
@@ -51,5 +51,5 @@ build-backend = "poetry.core.masonry.api"
|
|||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
mint = "cashu.mint.main:main"
|
mint = "cashu.mint.main:main"
|
||||||
cashu = "cashu.wallet.cli:cli"
|
cashu = "cashu.wallet.cli.cli:cli"
|
||||||
wallet-test = "tests.test_wallet:test"
|
wallet-test = "tests.test_wallet:test"
|
||||||
Reference in New Issue
Block a user