pub fn generate_blocktree_with_coding(ledger_path: &str, specs: &[SlotSpec]) -> Blocktree {
        let blocktree = Blocktree::open(ledger_path).unwrap();

        let model = generate_ledger_model(specs);
        for slot_model in model {
            let slot = slot_model.slot;

            for erasure_set in slot_model.chunks {
                blocktree.write_shared_blobs(erasure_set.data).unwrap();

                for shared_coding_blob in erasure_set.coding.into_iter() {
                    let blob = shared_coding_blob.read().unwrap();
                    blocktree
                        .put_coding_blob_bytes_raw(
                            slot,
                            blob.index(),
                            &blob.data[..blob.size() + BLOB_HEADER_SIZE],
                        )
                        .unwrap();
                }
            }
        }

        blocktree
    }
/// Genarates a ledger according to the given specs.
/// Blocktree should have correct SlotMeta and ErasureMeta and so on but will not have done any
/// possible recovery.
Genarates a ledger according to the given specs.
Blocktree should have correct SlotMeta and ErasureMeta and so on but will not have done any
possible recovery.
Genarates a ledger according to the given specs . Blocktree should have correct SlotMeta and ErasureMeta and so on but will not have done any possible recovery .
pub fn generate_blocktree_with_coding(ledger_path: &str, specs: &[SlotSpec]) -> Blocktree {
        let blocktree = Blocktree::open(ledger_path).unwrap();
        let model = generate_ledger_model(specs);
        for slot_model in model {
            let slot = slot_model.slot;
            for erasure_set in slot_model.chunks {
                blocktree.write_shared_blobs(erasure_set.data).unwrap();
                for shared_coding_blob in erasure_set.coding.into_iter() {
                    let blob = shared_coding_blob.read().unwrap();
                    blocktree
                        .put_coding_blob_bytes_raw(
                            slot,
                            blob.index(),
                            &blob.data[..blob.size() + BLOB_HEADER_SIZE],
                        )
                        .unwrap();
                }
            }
        }
        blocktree
    }
pub fn generate_blocktree_with_coding ( ledger_path : & str , specs : & [ SlotSpec ] ) -> Blocktree { let blocktree = Blocktree :: open ( ledger_path ) . unwrap ( ) ; let model = generate_ledger_model ( specs ) ; for slot_model in model { let slot = slot_model . slot ; for erasure_set in slot_model . chunks { blocktree . write_shared_blobs ( erasure_set . data ) . unwrap ( ) ; for shared_coding_blob in erasure_set . coding . into_iter ( ) { let blob = shared_coding_blob . read ( ) . unwrap ( ) ; blocktree . put_coding_blob_bytes_raw ( slot , blob . index ( ) , & blob . data [ .. blob . size ( ) + BLOB_HEADER_SIZE ] , ) . unwrap ( ) ; } } } blocktree }
Genarates a ledger according to the given specs.
Genarates a ledger according to the given specs .
ledger_path
&str
specs
&[SlotSpec]
ledger_path
&str
specs
&[SlotSpec]