-
Notifications
You must be signed in to change notification settings - Fork 333
/
Copy pathproving_job_database.ts
44 lines (39 loc) · 1.39 KB
/
proving_job_database.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import {
type V2ProofOutput,
type V2ProvingJob,
type V2ProvingJobId,
type V2ProvingJobResult,
} from '@aztec/circuit-types';
/**
* A database for storing proof requests and their results
*/
export interface ProvingJobDatabase {
/**
* Saves a proof request so it can be retrieved later
* @param request - The proof request to save
*/
addProvingJob(request: V2ProvingJob): Promise<void>;
/**
* Removes a proof request from the backend
* @param id - The ID of the proof request to remove
*/
deleteProvingJobAndResult(id: V2ProvingJobId): Promise<void>;
/**
* Returns an iterator over all saved proving jobs
*/
allProvingJobs(): Iterable<[V2ProvingJob, V2ProvingJobResult | undefined]>;
/**
* Saves the result of a proof request
* @param id - The ID of the proof request to save the result for
* @param ProvingRequestType - The type of proof that was requested
* @param value - The result of the proof request
*/
setProvingJobResult(id: V2ProvingJobId, value: V2ProofOutput): Promise<void>;
/**
* Saves an error that occurred while processing a proof request
* @param id - The ID of the proof request to save the error for
* @param ProvingRequestType - The type of proof that was requested
* @param err - The error that occurred while processing the proof request
*/
setProvingJobError(id: V2ProvingJobId, err: Error): Promise<void>;
}