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

Function ProofChainFindLatest

model/proof_chain.go:216–227  ·  view source on GitHub ↗
(persona string)

Source from the content-addressed store, hash-verified

214}
215
216func ProofChainFindLatest(persona string) (pc *ProofChain, err error) {
217 pc = new(ProofChain)
218 tx := ReadOnlyDB.Where("persona = ?", MarshalPersona(persona)).Order("id DESC").Take(pc)
219 if tx.Error != nil {
220 if strings.Contains(tx.Error.Error(), "record not found") {
221 return nil, nil
222 }
223 return nil, xerrors.Errorf("%w", tx.Error)
224 }
225
226 return pc, nil
227}
228
229func ProofChainFindBySignature(signature string) (pc *ProofChain, err error) {
230 previous := &ProofChain{}

Callers 4

performProofQueryFunction · 0.92
proofUploadFunction · 0.92
proofPayloadFunction · 0.92

Calls 1

MarshalPersonaFunction · 0.85

Tested by 1