Skip to content

Commit

Permalink
cli::spend_utils: Remove allow(clippy::arithmetic_side_effects) (so…
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-bobyr authored Apr 21, 2024
1 parent 6aacbf3 commit ff79531
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cli/src/spend_utils.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(clippy::arithmetic_side_effects)]

use {
crate::{
checks::{check_account_for_balance_with_commitment, get_fee_for_messages},
Expand Down Expand Up @@ -118,7 +116,7 @@ where
build_message,
)?;
if from_pubkey == fee_pubkey {
if from_balance == 0 || from_balance < spend + fee {
if from_balance == 0 || from_balance < spend.saturating_add(fee) {
return Err(CliError::InsufficientFundsForSpendAndFee(
lamports_to_sol(spend),
lamports_to_sol(fee),
Expand Down

0 comments on commit ff79531

Please sign in to comment.