src/host/test/ledger.cpp
// Assumes that no entries have been written yet
Assumes that no entries have been written yet
Assumes that no entries have been written yet
size_t initialise_ledger(
  TestEntrySubmitter& entry_submitter,
  size_t chunk_threshold,
  size_t chunk_count)
{
  size_t end_of_first_chunk_idx = 0;
  bool is_committable = true;
  size_t entries_per_chunk = get_entries_per_chunk(chunk_threshold);
  for (int i = 0; i < entries_per_chunk * chunk_count; i++)
  {
    entry_submitter.write(is_committable);
  }
  REQUIRE(number_of_files_in_ledger_dir() == chunk_count);
  return entries_per_chunk;
}
size_t initialise_ledger ( TestEntrySubmitter & entry_submitter , size_t chunk_threshold , size_t chunk_count ) { size_t end_of_first_chunk_idx = 0 ; bool is_committable = true ; size_t entries_per_chunk = get_entries_per_chunk ( chunk_threshold ) ; for ( int i = 0 ; i < entries_per_chunk * chunk_count ; i ++ ) { entry_submitter . write ( is_committable ) ; } REQUIRE ( number_of_files_in_ledger_dir ( ) == chunk_count ) ; return entries_per_chunk ; }
Assumes that no entries have been written yet
Assumes that no entries have been written yet