25 lines
572 B
Rust
25 lines
572 B
Rust
//! 宪政区块生产协议(CBPP - Constitutional Block Production Protocol)
|
||
//!
|
||
//! NAC公链的共识机制,结合DPoS和BFT的优点
|
||
|
||
pub mod block;
|
||
pub mod validator;
|
||
pub mod consensus;
|
||
pub mod vote;
|
||
|
||
pub use block::{Block, BlockHeader, BlockBody};
|
||
pub use validator::{Validator, ValidatorSet};
|
||
pub use consensus::{ConsensusEngine, ConsensusState};
|
||
pub use vote::{Vote, VoteType};
|
||
|
||
#[cfg(test)]
|
||
mod tests {
|
||
use super::*;
|
||
|
||
#[test]
|
||
fn test_cbpp_basic() {
|
||
let engine = ConsensusEngine::new();
|
||
assert!(engine.is_initialized());
|
||
}
|
||
}
|