ledger path reform: use Path/PathBuf instead of strings (#5344)

This commit is contained in:
Michael Vines
2019-07-30 15:53:41 -07:00
committed by GitHub
parent 294d9288d2
commit c78db6a94b
15 changed files with 76 additions and 54 deletions

View File

@@ -4,6 +4,7 @@ use solana::contact_info::ContactInfo;
use solana::replicator::Replicator;
use solana_sdk::signature::{read_keypair, Keypair, KeypairUtil};
use std::net::SocketAddr;
use std::path::PathBuf;
use std::process::exit;
use std::sync::Arc;
@@ -50,7 +51,7 @@ fn main() {
)
.get_matches();
let ledger_path = matches.value_of("ledger").unwrap();
let ledger_path = PathBuf::from(matches.value_of("ledger").unwrap());
let keypair = if let Some(identity) = matches.value_of("identity") {
read_keypair(identity).unwrap_or_else(|err| {
@@ -93,7 +94,7 @@ fn main() {
let entrypoint_info = ContactInfo::new_gossip_entry_point(&entrypoint_addr);
let replicator = Replicator::new(
ledger_path,
&ledger_path,
node,
entrypoint_info,
Arc::new(keypair),