Move ledger write to its own stage (#1577)

* Move ledger write to its own stage

- Also, rename write_stage to leader_vote_stage, as write functionality
  is moved to a different stage

* Address review comments

* Fix leader rotation test failure

* address review comments
This commit is contained in:
Pankaj Garg
2018-10-23 14:42:48 -07:00
committed by GitHub
parent c77b1c9687
commit 8d9912b4e2
13 changed files with 181 additions and 113 deletions

View File

@ -817,7 +817,7 @@ mod tests {
.iter()
.fold(0, |tick_count, entry| tick_count + entry.is_tick() as u64)
+ num_ending_ticks as u64;
ledger_writer.write_entries(active_set_entries).unwrap();
ledger_writer.write_entries(&active_set_entries).unwrap();
// Create the common leader scheduling configuration
let num_slots_per_epoch = 3;
@ -913,7 +913,7 @@ mod tests {
let initial_non_tick_height = genesis_entries.len() as u64 - initial_tick_height;
let active_set_entries_len = active_set_entries.len() as u64;
last_id = active_set_entries.last().unwrap().id;
ledger_writer.write_entries(active_set_entries).unwrap();
ledger_writer.write_entries(&active_set_entries).unwrap();
let ledger_initial_len = genesis_entries.len() as u64 + active_set_entries_len;
// Set the leader scheduler for the validator