Add first leader to genesis (#1681)

* Add first leader to genesis entries, consume in genesis.sh

* Set bootstrap leader in the bank on startup, remove instantiation of bootstrap leader from bin/fullnode

* Remove need to initialize bootstrap leader in leader_scheduler, now can be read from genesis entries

* Add separate interface new_with_leader() in mint for creating genesis leader entries
This commit is contained in:
carllin
2018-11-02 14:32:05 -07:00
committed by GitHub
parent a8481215fa
commit 298bd6479a
20 changed files with 427 additions and 208 deletions

View File

@@ -1825,16 +1825,24 @@ mod tests {
let obj = Arc::new(RwLock::new(cluster_info));
let request = Protocol::RequestUpdates(1, node.clone());
assert!(
ClusterInfo::handle_protocol(&obj, &node.contact_info.ncp, request, &window, &mut None,)
.is_none()
);
assert!(ClusterInfo::handle_protocol(
&obj,
&node.contact_info.ncp,
request,
&window,
&mut None,
)
.is_none());
let request = Protocol::RequestUpdates(1, node_with_same_addr.clone());
assert!(
ClusterInfo::handle_protocol(&obj, &node.contact_info.ncp, request, &window, &mut None,)
.is_none()
);
assert!(ClusterInfo::handle_protocol(
&obj,
&node.contact_info.ncp,
request,
&window,
&mut None,
)
.is_none());
let request = Protocol::RequestUpdates(1, node_with_diff_addr.clone());
ClusterInfo::handle_protocol(&obj, &node.contact_info.ncp, request, &window, &mut None);