node/transition_frontier/sync/ledger/snarked/
mod.rs1mod transition_frontier_sync_ledger_snarked_state;
2pub use transition_frontier_sync_ledger_snarked_state::*;
3
4mod transition_frontier_sync_ledger_snarked_actions;
5pub use transition_frontier_sync_ledger_snarked_actions::*;
6
7mod transition_frontier_sync_ledger_snarked_reducer;
8
9mod transition_frontier_sync_ledger_snarked_effects;
10
11mod transition_frontier_sync_ledger_snarked_service;
12pub use transition_frontier_sync_ledger_snarked_service::*;
13
14use mina_p2p_messages::v2::{LedgerHash, MinaBaseAccountBinableArgStableV2};
15use serde::{Deserialize, Serialize};
16
17#[derive(Serialize, Deserialize, Debug, Clone)]
18pub enum PeerLedgerQueryResponse {
19 ChildHashes(LedgerHash, LedgerHash),
20 ChildAccounts(Vec<MinaBaseAccountBinableArgStableV2>),
21 NumAccounts(u64, LedgerHash),
22}
23
24impl PeerLedgerQueryResponse {
25 pub fn is_child_hashes(&self) -> bool {
26 matches!(self, Self::ChildHashes(..))
27 }
28
29 pub fn is_child_accounts(&self) -> bool {
30 matches!(self, Self::ChildAccounts(..))
31 }
32
33 pub fn is_num_accounts(&self) -> bool {
34 matches!(self, Self::NumAccounts(..))
35 }
36}
37
38#[derive(Serialize, Deserialize, Debug, Clone)]
39pub enum PeerLedgerQueryError {
40 Timeout,
41 Disconnected,
42 DataUnavailable,
43}