forked from Ellipsis-Labs/solana-verifiable-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_models.rs
56 lines (49 loc) · 1.21 KB
/
api_models.rs
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
45
46
47
48
49
50
51
52
53
54
55
56
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum Status {
Success,
Error,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct VerifyResponse {
pub status: JobStatus,
pub request_id: String,
pub message: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct StatusResponse {
pub is_verified: bool,
pub message: String,
pub on_chain_hash: String,
pub executable_hash: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ErrorResponse {
pub status: Status,
pub error: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct JobResponse {
pub status: JobStatus,
pub respose: Option<JobVerificationResponse>,
}
#[derive(Debug, Serialize, Deserialize)]
pub enum JobStatus {
#[serde(rename = "in_progress")]
InProgress,
#[serde(rename = "completed")]
Completed,
#[serde(rename = "failed")]
Failed,
#[serde(rename = "unknown")]
Unknown,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct JobVerificationResponse {
pub status: JobStatus,
pub message: String,
pub on_chain_hash: String,
pub executable_hash: String,
pub repo_url: String,
}