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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#![allow(missing_docs)] use crate::common::*;
use mina_serialization_types_macros::AutoFrom;
use serde::{Deserialize, Serialize};
use versioned::Versioned;
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
pub struct BlockchainState {
pub staged_ledger_hash: StagedLedgerHashV1,
pub snarked_ledger_hash: HashV1,
pub genesis_ledger_hash: HashV1,
pub snarked_next_available_token: TokenIdV1,
pub timestamp: BlockTimeV1,
}
pub type BlockchainStateV1 = Versioned<Versioned<BlockchainState, 1>, 1>;
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq, AutoFrom)]
#[auto_from(BlockchainState)]
pub struct BlockchainStateJson {
pub staged_ledger_hash: StagedLedgerHashJson,
pub snarked_ledger_hash: LedgerHashV1Json,
pub genesis_ledger_hash: LedgerHashV1Json,
pub snarked_next_available_token: U64Json,
pub timestamp: U64Json,
}
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
pub struct StagedLedgerHash {
pub non_snark: NonSnarkStagedLedgerHashV1,
pub pending_coinbase_hash: Hash2V1,
}
pub type StagedLedgerHashV1 = Versioned<Versioned<StagedLedgerHash, 1>, 1>;
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq, AutoFrom)]
#[auto_from(StagedLedgerHash)]
pub struct StagedLedgerHashJson {
pub non_snark: NonSnarkStagedLedgerHashJson,
pub pending_coinbase_hash: CoinBaseHashV1Json,
}
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
pub struct NonSnarkStagedLedgerHash {
pub ledger_hash: HashV1,
pub aux_hash: ByteVecV1,
pub pending_coinbase_aux: ByteVecV1,
}
pub type NonSnarkStagedLedgerHashV1 = Versioned<NonSnarkStagedLedgerHash, 1>;
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq, AutoFrom)]
#[auto_from(NonSnarkStagedLedgerHash)]
pub struct NonSnarkStagedLedgerHashJson {
pub ledger_hash: LedgerHashV1Json,
pub aux_hash: AuxHashJson,
pub pending_coinbase_aux: PendingCoinbaseAuxHashJson,
}