get rid of baggage

This commit is contained in:
callebtc
2023-01-14 21:31:09 +01:00
parent 3cbdebf5a5
commit 97aee02e0c
2 changed files with 5 additions and 8 deletions

View File

@@ -130,7 +130,7 @@ class GetMeltResponse(BaseModel):
class SplitRequest(BaseModel):
proofs: List[Proof]
amount: int
outputs: Union[List[BlindedMessage], None] = None
outputs: List[BlindedMessage]
class PostSplitResponse(BaseModel):

View File

@@ -120,14 +120,11 @@ async def split(
Requetst a set of tokens with amount "total" to be split into two
newly minted sets with amount "split" and "total-split".
"""
proofs = payload.proofs
amount = payload.amount
outputs = payload.outputs or None
assert outputs, Exception("no outputs provided.")
assert payload.outputs, Exception("no outputs provided.")
try:
split_return = await ledger.split(proofs, amount, outputs)
split_return = await ledger.split(
payload.proofs, payload.amount, payload.outputs
)
except Exception as exc:
return CashuError(code=0, error=str(exc))
if not split_return: