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
pub use self::{constants::*, mnhash::*, types::*};
pub(crate) mod mnhash;
pub(crate) mod constants {
pub const DIFFICULTY_PREFIX: &str = "00";
pub const INITIAL_POW_DIFFICULTY: [u8; 32] = [
0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0,
];
pub const INITIAL_POS_DIFFICULTY: [u8; 32] = [1; 32];
}
pub(crate) mod types {
use crate::transactions::{SignedTransaction, Transaction};
use scsys::prelude::{chrono, H160, H256};
use std::collections::HashMap;
pub type BlockId = i64;
pub type BlockHs = H256;
pub type BlockNc = u32;
pub type BlockTs = i64;
pub type BlockTz = chrono::Utc;
pub type BlockData<Dt = String> = Vec<Dt>;
pub type BlockState = HashMap<H256, StateMap>;
pub type SignedTransactions = Vec<SignedTransaction>;
pub type StateMap = HashMap<H160, (usize, usize)>;
pub type Transactions = Vec<Transaction>;
}