Use default client keypair if --faucet-keypair is not provided
This commit is contained in:
		| @@ -17,6 +17,7 @@ serde_json = "1.0.56" | |||||||
| serde_yaml = "0.8.13" | serde_yaml = "0.8.13" | ||||||
| solana-budget-program = { path = "../programs/budget", version = "1.5.0" } | solana-budget-program = { path = "../programs/budget", version = "1.5.0" } | ||||||
| solana-clap-utils = { path = "../clap-utils", 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-exchange-program = { path = "../programs/exchange", version = "1.5.0" } | ||||||
| solana-ledger = { path = "../ledger", version = "1.5.0" } | solana-ledger = { path = "../ledger", version = "1.5.0" } | ||||||
| solana-logger = { path = "../logger", version = "1.5.0" } | solana-logger = { path = "../logger", version = "1.5.0" } | ||||||
|   | |||||||
| @@ -99,6 +99,7 @@ pub fn load_genesis_accounts(file: &str, genesis_config: &mut GenesisConfig) -> | |||||||
|  |  | ||||||
| #[allow(clippy::cognitive_complexity)] | #[allow(clippy::cognitive_complexity)] | ||||||
| fn main() -> Result<(), Box<dyn error::Error>> { | 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 fee_rate_governor = FeeRateGovernor::default(); | ||||||
|     let ( |     let ( | ||||||
|         default_target_lamports_per_signature, |         default_target_lamports_per_signature, | ||||||
| @@ -178,7 +179,6 @@ fn main() -> Result<(), Box<dyn error::Error>> { | |||||||
|                 .long("faucet-lamports") |                 .long("faucet-lamports") | ||||||
|                 .value_name("LAMPORTS") |                 .value_name("LAMPORTS") | ||||||
|                 .takes_value(true) |                 .takes_value(true) | ||||||
|                 .requires("faucet_pubkey") |  | ||||||
|                 .help("Number of lamports to assign to the faucet"), |                 .help("Number of lamports to assign to the faucet"), | ||||||
|         ) |         ) | ||||||
|         .arg( |         .arg( | ||||||
| @@ -189,6 +189,7 @@ fn main() -> Result<(), Box<dyn error::Error>> { | |||||||
|                 .takes_value(true) |                 .takes_value(true) | ||||||
|                 .validator(is_pubkey_or_keypair) |                 .validator(is_pubkey_or_keypair) | ||||||
|                 .requires("faucet_lamports") |                 .requires("faucet_lamports") | ||||||
|  |                 .default_value(&default_faucet_pubkey) | ||||||
|                 .help("Path to file containing the faucet's pubkey"), |                 .help("Path to file containing the faucet's pubkey"), | ||||||
|         ) |         ) | ||||||
|         .arg( |         .arg( | ||||||
| @@ -364,7 +365,6 @@ fn main() -> Result<(), Box<dyn error::Error>> { | |||||||
|         ) |         ) | ||||||
|         .get_matches(); |         .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 ledger_path = PathBuf::from(matches.value_of("ledger_path").unwrap()); | ||||||
|  |  | ||||||
|     let rent = Rent { |     let rent = Rent { | ||||||
| @@ -414,6 +414,7 @@ fn main() -> Result<(), Box<dyn error::Error>> { | |||||||
|  |  | ||||||
|     let bootstrap_stake_authorized_pubkey = |     let bootstrap_stake_authorized_pubkey = | ||||||
|         pubkey_of(&matches, "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 faucet_pubkey = pubkey_of(&matches, "faucet_pubkey"); | ||||||
|  |  | ||||||
|     let ticks_per_slot = value_t_or_exit!(matches, "ticks_per_slot", u64); |     let ticks_per_slot = value_t_or_exit!(matches, "ticks_per_slot", u64); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user