mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-21 11:04:19 +01:00
get rid of baggage
This commit is contained in:
@@ -130,7 +130,7 @@ class GetMeltResponse(BaseModel):
|
|||||||
class SplitRequest(BaseModel):
|
class SplitRequest(BaseModel):
|
||||||
proofs: List[Proof]
|
proofs: List[Proof]
|
||||||
amount: int
|
amount: int
|
||||||
outputs: Union[List[BlindedMessage], None] = None
|
outputs: List[BlindedMessage]
|
||||||
|
|
||||||
|
|
||||||
class PostSplitResponse(BaseModel):
|
class PostSplitResponse(BaseModel):
|
||||||
|
|||||||
@@ -120,14 +120,11 @@ async def split(
|
|||||||
Requetst a set of tokens with amount "total" to be split into two
|
Requetst a set of tokens with amount "total" to be split into two
|
||||||
newly minted sets with amount "split" and "total-split".
|
newly minted sets with amount "split" and "total-split".
|
||||||
"""
|
"""
|
||||||
proofs = payload.proofs
|
assert payload.outputs, Exception("no outputs provided.")
|
||||||
amount = payload.amount
|
|
||||||
|
|
||||||
outputs = payload.outputs or None
|
|
||||||
|
|
||||||
assert outputs, Exception("no outputs provided.")
|
|
||||||
try:
|
try:
|
||||||
split_return = await ledger.split(proofs, amount, outputs)
|
split_return = await ledger.split(
|
||||||
|
payload.proofs, payload.amount, payload.outputs
|
||||||
|
)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
return CashuError(code=0, error=str(exc))
|
return CashuError(code=0, error=str(exc))
|
||||||
if not split_return:
|
if not split_return:
|
||||||
|
|||||||
Reference in New Issue
Block a user