Skip to content

Commit

Permalink
[feature] hyperledger#3027: implement lockfile for Kura
Browse files Browse the repository at this point in the history
Co-authored-by: Ekaterina Mekhnetsova <mekkatya@gmail.com>
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
  • Loading branch information
Artemii Gerasimovich and outoftardis committed Dec 26, 2022
1 parent 5d2dd5f commit 4c1886c
Show file tree
Hide file tree
Showing 4 changed files with 305 additions and 131 deletions.
1 change: 1 addition & 0 deletions client/tests/integration/restart_peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ fn restarted_peer_should_have_the_same_asset_amount() -> Result<()> {
.find(|asset| asset.id().definition_id == asset_definition_id)
.expect("Asset not found");
assert_eq!(AssetValue::Quantity(quantity), *asset.value());
peer.stop();
}

{
Expand Down
6 changes: 4 additions & 2 deletions core/benches/kura.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ async fn measure_block_size_for_n_validators(n_validators: u32) {
.unwrap();
}
let block: VersionedCommittedBlock = block.commit_unchecked().into();
let mut block_store = BlockStore::new(dir.path());
let mut block_store = BlockStore::new(dir.path())
.lock()
.expect("Failed to lock store");
block_store.create_files_if_they_do_not_exist().unwrap();

let serialized_block: Vec<u8> = block.encode_versioned();
Expand All @@ -69,7 +71,7 @@ async fn measure_block_size_for_n_validators(n_validators: u32) {

let metadata = fs::metadata(dir.path().join("blocks.data")).await.unwrap();
let file_size = Byte::from_bytes(u128::from(metadata.len())).get_appropriate_unit(false);
println!("For {} validators: {}", n_validators, file_size);
println!("For {n_validators} validators: {file_size}");
}

async fn measure_block_size_async() {
Expand Down
Loading

0 comments on commit 4c1886c

Please sign in to comment.