33 lines
1014 B
Rust
33 lines
1014 B
Rust
//! 宪政区块生产协议(CBPP - Constitutional Block Production Protocol)
|
||
//!
|
||
//! NAC公链的共识机制,结合DPoS和BFT的优点
|
||
|
||
pub mod block;
|
||
pub mod validator;
|
||
pub mod consensus;
|
||
pub mod vote;
|
||
pub mod validation;
|
||
pub mod signature;
|
||
pub mod timeout;
|
||
pub mod fork;
|
||
|
||
pub use block::{Block, BlockHeader, BlockBody};
|
||
pub use validator::{Validator, ValidatorSet};
|
||
pub use consensus::{ConsensusEngine, ConsensusState};
|
||
pub use vote::{Vote, VoteType};
|
||
pub use validation::{BlockValidator, ValidationError, ComplianceChecker};
|
||
pub use signature::{BlsPrivateKey, BlsPublicKey, BlsSignature, AggregateSignature, KeyManager, SignatureVerifier};
|
||
pub use timeout::{TimeoutManager, TimeoutConfig, TimeoutType, TimeoutEvent};
|
||
pub use fork::{ForkDetector, ForkChoiceSelector, ForkRecovery, ForkPrevention, ForkInfo, ForkChoiceRule};
|
||
|
||
#[cfg(test)]
|
||
mod tests {
|
||
use super::*;
|
||
|
||
#[test]
|
||
fn test_cbpp_basic() {
|
||
let engine = ConsensusEngine::new();
|
||
assert!(engine.is_initialized());
|
||
}
|
||
}
|