-
Notifications
You must be signed in to change notification settings - Fork 222
/
request.rs
43 lines (37 loc) · 828 Bytes
/
request.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
use hash::Hash;
use signature::Signature;
use xpz_program_interface::account::Account;
use xpz_program_interface::pubkey::Pubkey;
#[cfg_attr(feature = "cargo-clippy", allow(large_enum_variant))]
#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
pub enum Request {
GetAccount { key: Pubkey },
GetLastId,
GetTransactionCount,
GetSignature { signature: Signature },
GetFinality,
}
impl Request {
pub fn verify(&self) -> bool {
true
}
}
#[derive(Serialize, Deserialize, Debug)]
pub enum Response {
Account {
key: Pubkey,
account: Option<Account>,
},
LastId {
id: Hash,
},
TransactionCount {
transaction_count: u64,
},
SignatureStatus {
signature_status: bool,
},
Finality {
time: usize,
},
}