mirror of
https://github.com/logos-blockchain/logos-blockchain-block-explorer-template.git
synced 2026-02-17 19:43:08 +00:00
11 lines
356 B
Python
11 lines
356 B
Python
from http.client import NOT_FOUND
|
|
|
|
from starlette.responses import JSONResponse, Response
|
|
|
|
from core.api import NBERequest
|
|
|
|
|
|
async def get(request: NBERequest) -> Response:
|
|
fork = await request.app.state.block_repository.get_fork_choice()
|
|
return fork.map(lambda f: JSONResponse({"fork": f})).unwrap_or_else(lambda: Response(status_code=NOT_FOUND))
|