Replace DEFAULT_SLOT_HEIGHT with 0

This commit is contained in:
Michael Vines
2019-02-25 12:48:48 -08:00
parent 2be7896157
commit 6088b3bfc8
10 changed files with 53 additions and 142 deletions

View File

@@ -1,8 +1,6 @@
use log::*;
use solana::blob_fetch_stage::BlobFetchStage;
use solana::blocktree::{
create_tmp_sample_blocktree, tmp_copy_blocktree, Blocktree, DEFAULT_SLOT_HEIGHT,
};
use solana::blocktree::{create_tmp_sample_blocktree, tmp_copy_blocktree, Blocktree};
use solana::client::mk_client;
use solana::cluster_info::{Node, NodeInfo};
use solana::entry::{reconstruct_entries_from_blobs, Entry};
@@ -69,12 +67,7 @@ fn test_multi_node_ledger_window() -> result::Result<()> {
last_entry_id,
);
blocktree
.write_entries(
DEFAULT_SLOT_HEIGHT,
tick_height,
last_entry_height,
&entries,
)
.write_entries(0, tick_height, last_entry_height, &entries)
.unwrap();
last_entry_height += entries.len() as u64;
@@ -912,12 +905,7 @@ fn test_leader_to_validator_transition() {
{
let blocktree = Blocktree::open_config(&leader_ledger_path, ticks_per_slot).unwrap();
blocktree
.write_entries(
DEFAULT_SLOT_HEIGHT,
tick_height,
genesis_entry_height,
&active_set_entries,
)
.write_entries(0, tick_height, genesis_entry_height, &active_set_entries)
.unwrap();
}
info!("leader id: {}", leader_keypair.pubkey());
@@ -1015,12 +1003,7 @@ fn test_leader_validator_basic() {
{
let blocktree = Blocktree::open_config(&leader_ledger_path, ticks_per_slot).unwrap();
blocktree
.write_entries(
DEFAULT_SLOT_HEIGHT,
tick_height,
genesis_entry_height,
&active_set_entries,
)
.write_entries(0, tick_height, genesis_entry_height, &active_set_entries)
.unwrap();
}
@@ -1170,12 +1153,7 @@ fn test_dropped_handoff_recovery() {
{
let blocktree = Blocktree::open_config(&genesis_ledger_path, ticks_per_slot).unwrap();
blocktree
.write_entries(
DEFAULT_SLOT_HEIGHT,
tick_height,
genesis_entry_height,
&active_set_entries,
)
.write_entries(0, tick_height, genesis_entry_height, &active_set_entries)
.unwrap();
}
@@ -1341,12 +1319,7 @@ fn test_full_leader_validator_network() {
let blocktree =
Blocktree::open_config(&bootstrap_leader_ledger_path, ticks_per_slot).unwrap();
blocktree
.write_entries(
DEFAULT_SLOT_HEIGHT,
tick_height,
entry_height,
&active_set_entries,
)
.write_entries(0, tick_height, entry_height, &active_set_entries)
.unwrap();
entry_height += active_set_entries.len() as u64;
}

View File

@@ -8,7 +8,6 @@ extern crate serde_json;
use bincode::deserialize;
use solana::blocktree::{
create_tmp_sample_blocktree, get_tmp_ledger_path, tmp_copy_blocktree, Blocktree,
DEFAULT_SLOT_HEIGHT,
};
use solana::client::mk_client;
use solana::cluster_info::{ClusterInfo, Node, NodeInfo};
@@ -155,7 +154,7 @@ fn test_replicator_startup_basic() {
let cluster_info = ClusterInfo::new(tn.info.clone());
let repair_index = replicator.entry_height();
let req = cluster_info
.window_index_request_bytes(DEFAULT_SLOT_HEIGHT, repair_index)
.window_index_request_bytes(0, repair_index)
.unwrap();
let exit = Arc::new(AtomicBool::new(false));