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
mod blockchain;
mod consensus;
mod utils;
pub use crate::{
blockchain::*,
common::*,
consensus::*,
errors::*,
utils::*,
};
mod errors {
use std::error::Error;
pub type ChainError = Box<dyn Error + Send + Sync + 'static>;
}
mod common {
pub use constants::*;
pub use types::*;
pub mod constants {
pub const DIFFICULTY_PREFIX: &str = "00";
}
pub mod types {
pub type BlockData = String;
pub type BlockId = u64;
pub type BlockHash = String;
pub type BlockNonce = u64;
pub type BlockTime = i64;
}
}