pub fn create_initial_fake_ledger(
        discrimination: Discrimination,
        initial_msgs: &[Message],
    ) -> (HeaderHash, Ledger) {
        let block0_hash = HeaderHash::hash_bytes(&[1, 2, 3]);

        let mut ie = config::ConfigParams::new();
        ie.push(ConfigParam::Discrimination(discrimination));
        ie.push(ConfigParam::ConsensusVersion(ConsensusVersion::Bft));

        // TODO remove rng: make this creation deterministic
        let leader_pub_key = SecretKey::generate(rand::thread_rng()).to_public();
        ie.push(ConfigParam::AddBftLeader(leader_pub_key.into()));
        ie.push(ConfigParam::Block0Date(crate::config::Block0Date(0)));
        ie.push(ConfigParam::SlotDuration(10));
        ie.push(ConfigParam::ConsensusGenesisPraosActiveSlotsCoeff(
            Milli::HALF,
        ));
        ie.push(ConfigParam::SlotsPerEpoch(21600));
        ie.push(ConfigParam::KESUpdateSpeed(3600 * 12));
        ie.push(ConfigParam::AllowAccountCreation(true));

        let mut messages = Vec::new();
        messages.push(Message::Initial(ie));
        messages.extend_from_slice(initial_msgs);

        let ledger =
            Ledger::new(block0_hash, &messages).expect("create initial fake ledger failed");

        (block0_hash, ledger)
    }
// create an initial fake ledger with the non-optional parameter setup
create an initial fake ledger with the non-optional parameter setup
create an initial fake ledger with the non - optional parameter setup
pub fn create_initial_fake_ledger(
        discrimination: Discrimination,
        initial_msgs: &[Message],
    ) -> (HeaderHash, Ledger) {
        let block0_hash = HeaderHash::hash_bytes(&[1, 2, 3]);
        let mut ie = config::ConfigParams::new();
        ie.push(ConfigParam::Discrimination(discrimination));
        ie.push(ConfigParam::ConsensusVersion(ConsensusVersion::Bft));
        // TODO remove rng: make this creation deterministic
        let leader_pub_key = SecretKey::generate(rand::thread_rng()).to_public();
        ie.push(ConfigParam::AddBftLeader(leader_pub_key.into()));
        ie.push(ConfigParam::Block0Date(crate::config::Block0Date(0)));
        ie.push(ConfigParam::SlotDuration(10));
        ie.push(ConfigParam::ConsensusGenesisPraosActiveSlotsCoeff(
            Milli::HALF,
        ));
        ie.push(ConfigParam::SlotsPerEpoch(21600));
        ie.push(ConfigParam::KESUpdateSpeed(3600 * 12));
        ie.push(ConfigParam::AllowAccountCreation(true));
        let mut messages = Vec::new();
        messages.push(Message::Initial(ie));
        messages.extend_from_slice(initial_msgs);
        let ledger =
            Ledger::new(block0_hash, &messages).expect("create initial fake ledger failed");
        (block0_hash, ledger)
    }
pub fn create_initial_fake_ledger ( discrimination : Discrimination , initial_msgs : & [ Message ] , ) -> ( HeaderHash , Ledger ) { let block0_hash = HeaderHash :: hash_bytes ( & [ 1 , 2 , 3 ] ) ; let mut ie = config :: ConfigParams :: new ( ) ; ie . push ( ConfigParam :: Discrimination ( discrimination ) ) ; ie . push ( ConfigParam :: ConsensusVersion ( ConsensusVersion :: Bft ) ) ; // TODO remove rng: make this creation deterministic let leader_pub_key = SecretKey :: generate ( rand :: thread_rng ( ) ) . to_public ( ) ; ie . push ( ConfigParam :: AddBftLeader ( leader_pub_key . into ( ) ) ) ; ie . push ( ConfigParam :: Block0Date ( crate :: config :: Block0Date ( 0 ) ) ) ; ie . push ( ConfigParam :: SlotDuration ( 10 ) ) ; ie . push ( ConfigParam :: ConsensusGenesisPraosActiveSlotsCoeff ( Milli :: HALF , ) ) ; ie . push ( ConfigParam :: SlotsPerEpoch ( 21600 ) ) ; ie . push ( ConfigParam :: KESUpdateSpeed ( 3600 * 12 ) ) ; ie . push ( ConfigParam :: AllowAccountCreation ( true ) ) ; let mut messages = Vec :: new ( ) ; messages . push ( Message :: Initial ( ie ) ) ; messages . extend_from_slice ( initial_msgs ) ; let ledger = Ledger :: new ( block0_hash , & messages ) . expect ( " " ) ; ( block0_hash , ledger ) }
create an initial fake ledger with the non-optional parameter setup
create an initial fake ledger with the non - optional parameter setup
discrimination
Discrimination
initial_msgs
&[Message]
discrimination
Discrimination
initial_msgs
&[Message]