MCPcopy Create free account
hub / github.com/NextDotID/proof_server / proofChainQuery

Function proofChainQuery

controller/proof_chain.go:28–49  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

26}
27
28func proofChainQuery(c *gin.Context) {
29 req := ProofChainRequest{}
30 if err := c.BindQuery(&req); err != nil {
31 errorResp(c, http.StatusBadRequest, xerrors.Errorf("Param error"))
32 return
33 }
34 if len(req.PersonaPubkeyHex) == 0 {
35 errorResp(c, http.StatusBadRequest, xerrors.Errorf("Param missing"))
36 return
37 }
38
39 list, pagination, err := performProofChainQuery(req)
40 if err != nil {
41 errorResp(c, http.StatusInternalServerError, xerrors.Errorf("Error in DB: %w", err))
42 return
43 }
44
45 c.JSON(http.StatusOK, ProofChainResponse{
46 Pagination: pagination,
47 ProofChains: list,
48 })
49}
50
51func performProofChainQuery(req ProofChainRequest) ([]model.ProofChainItem, ProofChainPaginationResponse, error) {
52 pagination := ProofChainPaginationResponse{

Callers

nothing calls this directly

Calls 2

performProofChainQueryFunction · 0.85
errorRespFunction · 0.70

Tested by

no test coverage detected