mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-24 03:54:21 +01:00
Multinut LND (#492)
* amount in melt request * apply fee limit * more error handling * wip: signal flag in /info * clean up multinut * decode mypy error lndrest * fix test * fix tests * signal feature and blindmessages_deprecated * setting * fix blindedsignature method * fix tests * mint info file * test mpp with lnd regtest * nuts optionsl mint info * try to enable mpp with lnd * test mpp with third payment
This commit is contained in:
@@ -20,7 +20,7 @@ from ..core.base import (
|
||||
PostMintQuoteRequest,
|
||||
PostMintRequest_deprecated,
|
||||
PostMintResponse_deprecated,
|
||||
PostRestoreRequest,
|
||||
PostRestoreRequest_Deprecated,
|
||||
PostRestoreResponse,
|
||||
PostSplitRequest_Deprecated,
|
||||
PostSplitResponse_Deprecated,
|
||||
@@ -179,7 +179,7 @@ async def mint_deprecated(
|
||||
# BEGIN BACKWARDS COMPATIBILITY < 0.15
|
||||
# Mint expects "id" in outputs to know which keyset to use to sign them.
|
||||
outputs: list[BlindedMessage] = [
|
||||
BlindedMessage(id=o.id or ledger.keyset.id, **o.dict(exclude={"id"}))
|
||||
BlindedMessage(id=ledger.keyset.id, **o.dict(exclude={"id"}))
|
||||
for o in payload.outputs
|
||||
]
|
||||
# END BACKWARDS COMPATIBILITY < 0.15
|
||||
@@ -223,7 +223,7 @@ async def melt_deprecated(
|
||||
# BEGIN BACKWARDS COMPATIBILITY < 0.14: add "id" to outputs
|
||||
if payload.outputs:
|
||||
outputs: list[BlindedMessage] = [
|
||||
BlindedMessage(id=o.id or ledger.keyset.id, **o.dict(exclude={"id"}))
|
||||
BlindedMessage(id=ledger.keyset.id, **o.dict(exclude={"id"}))
|
||||
for o in payload.outputs
|
||||
]
|
||||
else:
|
||||
@@ -295,7 +295,7 @@ async def split_deprecated(
|
||||
assert payload.outputs, Exception("no outputs provided.")
|
||||
# BEGIN BACKWARDS COMPATIBILITY < 0.14: add "id" to outputs
|
||||
outputs: list[BlindedMessage] = [
|
||||
BlindedMessage(id=o.id or ledger.keyset.id, **o.dict(exclude={"id"}))
|
||||
BlindedMessage(id=ledger.keyset.id, **o.dict(exclude={"id"}))
|
||||
for o in payload.outputs
|
||||
]
|
||||
# END BACKWARDS COMPATIBILITY < 0.14
|
||||
@@ -372,7 +372,15 @@ async def check_spendable_deprecated(
|
||||
),
|
||||
deprecated=True,
|
||||
)
|
||||
async def restore(payload: PostRestoreRequest) -> PostRestoreResponse:
|
||||
async def restore(payload: PostRestoreRequest_Deprecated) -> PostRestoreResponse:
|
||||
assert payload.outputs, Exception("no outputs provided.")
|
||||
outputs, promises = await ledger.restore(payload.outputs)
|
||||
if payload.outputs:
|
||||
outputs: list[BlindedMessage] = [
|
||||
BlindedMessage(id=ledger.keyset.id, **o.dict(exclude={"id"}))
|
||||
for o in payload.outputs
|
||||
]
|
||||
else:
|
||||
outputs = []
|
||||
|
||||
outputs, promises = await ledger.restore(outputs)
|
||||
return PostRestoreResponse(outputs=outputs, signatures=promises)
|
||||
|
||||
Reference in New Issue
Block a user