Use default client keypair if --faucet-keypair is not provided

This commit is contained in:
Michael Vines 2020-11-16 08:44:20 -08:00
parent e9e5ee4362
commit 4069e7b663
2 changed files with 4 additions and 2 deletions

View File

@ -17,6 +17,7 @@ serde_json = "1.0.56"
serde_yaml = "0.8.13"
solana-budget-program = { path = "../programs/budget", version = "1.5.0" }
solana-clap-utils = { path = "../clap-utils", version = "1.5.0" }
solana-cli-config = { path = "../cli-config", version = "1.5.0" }
solana-exchange-program = { path = "../programs/exchange", version = "1.5.0" }
solana-ledger = { path = "../ledger", version = "1.5.0" }
solana-logger = { path = "../logger", version = "1.5.0" }

View File

@ -99,6 +99,7 @@ pub fn load_genesis_accounts(file: &str, genesis_config: &mut GenesisConfig) ->
#[allow(clippy::cognitive_complexity)]
fn main() -> Result<(), Box<dyn error::Error>> {
let default_faucet_pubkey = solana_cli_config::Config::default().keypair_path;
let fee_rate_governor = FeeRateGovernor::default();
let (
default_target_lamports_per_signature,
@ -178,7 +179,6 @@ fn main() -> Result<(), Box<dyn error::Error>> {
.long("faucet-lamports")
.value_name("LAMPORTS")
.takes_value(true)
.requires("faucet_pubkey")
.help("Number of lamports to assign to the faucet"),
)
.arg(
@ -189,6 +189,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
.takes_value(true)
.validator(is_pubkey_or_keypair)
.requires("faucet_lamports")
.default_value(&default_faucet_pubkey)
.help("Path to file containing the faucet's pubkey"),
)
.arg(
@ -364,7 +365,6 @@ fn main() -> Result<(), Box<dyn error::Error>> {
)
.get_matches();
let faucet_lamports = value_t!(matches, "faucet_lamports", u64).unwrap_or(0);
let ledger_path = PathBuf::from(matches.value_of("ledger_path").unwrap());
let rent = Rent {
@ -414,6 +414,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
let bootstrap_stake_authorized_pubkey =
pubkey_of(&matches, "bootstrap_stake_authorized_pubkey");
let faucet_lamports = value_t!(matches, "faucet_lamports", u64).unwrap_or(0);
let faucet_pubkey = pubkey_of(&matches, "faucet_pubkey");
let ticks_per_slot = value_t_or_exit!(matches, "ticks_per_slot", u64);