Add get_finality request and use it from multinode test (#941)

This commit is contained in:
Pankaj Garg
2018-08-13 08:55:13 -07:00
committed by GitHub
parent 288ed7a8ea
commit bf15cad36b
6 changed files with 73 additions and 2 deletions

View File

@ -695,12 +695,13 @@ fn test_multi_node_dynamic_network() {
info!("{} nodes are lagging behind leader", num_nodes_behind);
}
info!(
"SUCCESS[{}] {} out of {} distance: {} max_distance: {}",
"SUCCESS[{}] {} out of {} distance: {} max_distance: {} finality: {}",
i,
success,
validators.len(),
total_distance,
max_distance
max_distance,
get_finality(&leader_data)
);
if success == validators.len() && total_distance == 0 {
consecutive_success += 1;
@ -820,3 +821,9 @@ fn retry_send_tx_and_retry_get_balance(
}
None
}
fn get_finality(leader: &NodeInfo) -> usize {
let mut client = mk_client(leader);
trace!("getting leader finality");
client.get_finality()
}