mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-21 19:14:19 +01:00
Use PostRestoreRequest for all restore operations (#483)
* use PostRestoreRequest for all restore operations * refactor: unit method verification
This commit is contained in:
@@ -20,6 +20,7 @@ from ..core.base import (
|
||||
PostMintQuoteResponse,
|
||||
PostMintRequest,
|
||||
PostMintResponse,
|
||||
PostRestoreRequest,
|
||||
PostRestoreResponse,
|
||||
PostSplitRequest,
|
||||
PostSplitResponse,
|
||||
@@ -358,14 +359,14 @@ async def check_state(
|
||||
@router.post(
|
||||
"/v1/restore",
|
||||
name="Restore",
|
||||
summary="Restores a blinded signature from a secret",
|
||||
summary="Restores blind signature for a set of outputs.",
|
||||
response_model=PostRestoreResponse,
|
||||
response_description=(
|
||||
"Two lists with the first being the list of the provided outputs that "
|
||||
"have an associated blinded signature which is given in the second list."
|
||||
),
|
||||
)
|
||||
async def restore(payload: PostMintRequest) -> PostRestoreResponse:
|
||||
async def restore(payload: PostRestoreRequest) -> PostRestoreResponse:
|
||||
assert payload.outputs, Exception("no outputs provided.")
|
||||
outputs, signatures = await ledger.restore(payload.outputs)
|
||||
return PostRestoreResponse(outputs=outputs, signatures=signatures)
|
||||
|
||||
Reference in New Issue
Block a user