Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
pr feedback: add test impl for ErasureConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
AshwinSekar committed Oct 25, 2023
1 parent 3196f26 commit 9d9252a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 1 addition & 4 deletions ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7511,10 +7511,7 @@ pub mod tests {
let blockstore = Blockstore::open(ledger_path.path()).unwrap();
let erasure_meta_cf = &blockstore.erasure_meta_cf;

let config = ErasureConfig {
num_data: 1,
num_coding: 17,
};
let config = ErasureConfig::new(1, 17);
let erasure_meta_old = ErasureMetaLegacy {
set_index: 5,
first_coding_index: 8,
Expand Down
14 changes: 12 additions & 2 deletions ledger/src/blockstore_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,18 @@ pub struct ErasureMeta {

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub(crate) struct ErasureConfig {
pub(crate) num_data: usize,
pub(crate) num_coding: usize,
num_data: usize,
num_coding: usize,
}

#[cfg(test)]
impl ErasureConfig {
pub(crate) fn new(num_data: usize, num_coding: usize) -> Self {
ErasureConfig {
num_data,
num_coding,
}
}
}

#[derive(Deserialize, Serialize)]
Expand Down

0 comments on commit 9d9252a

Please sign in to comment.