Update crate references

This commit is contained in:
Tyera Eulberg
2019-03-12 18:27:52 -06:00
committed by Tyera Eulberg
parent 7cecd3851a
commit 2a4f4b3e53
21 changed files with 66 additions and 483 deletions

View File

@@ -372,6 +372,31 @@ pub fn make_active_set_entries(
(entries, voting_keypair)
}
pub fn new_fullnode_for_tests() -> (Fullnode, ContactInfo, Keypair, String) {
use crate::blocktree::create_new_tmp_ledger;
use crate::cluster_info::Node;
let node_keypair = Arc::new(Keypair::new());
let node = Node::new_localhost_with_pubkey(&node_keypair.pubkey());
let contact_info = node.info.clone();
let (genesis_block, mint_keypair) = GenesisBlock::new_with_leader(10_000, &contact_info.id, 42);
let (ledger_path, _blockhash) = create_new_tmp_ledger!(&genesis_block);
let voting_keypair = Keypair::new();
let node = Fullnode::new(
node,
&node_keypair,
&ledger_path,
&voting_keypair.pubkey(),
voting_keypair,
None,
&FullnodeConfig::default(),
);
(node, contact_info, mint_keypair, ledger_path)
}
#[cfg(test)]
mod tests {
use super::*;