CLI: Don't hide errors when fees are disabled (#8204)

automerge

(cherry picked from commit ed87229cec)
This commit is contained in:
Trent Nelson
2020-02-11 22:48:04 -07:00
committed by Michael Vines
parent 47f887bda0
commit 66f006108c
3 changed files with 17 additions and 20 deletions

View File

@@ -802,12 +802,11 @@ fn check_account_for_multiple_fees(
) -> Result<(), Box<dyn error::Error>> {
let balance = rpc_client.retry_get_balance(account_pubkey, 5)?;
if let Some(lamports) = balance {
if lamports
>= messages
.iter()
.map(|message| fee_calculator.calculate_fee(message))
.sum()
{
let fee = messages
.iter()
.map(|message| fee_calculator.calculate_fee(message))
.sum();
if lamports != 0 && lamports >= fee {
return Ok(());
}
}
@@ -3188,7 +3187,6 @@ mod tests {
};
assert!(process_command(&config).is_ok());
config.rpc_client = Some(RpcClient::new_mock("airdrop".to_string()));
config.command = CliCommand::TimeElapsed(bob_pubkey, process_id, dt);
let signature = process_command(&config);
assert_eq!(signature.unwrap(), SIGNATURE.to_string());