Skip to content

Commit

Permalink
rent_limit_check
Browse files Browse the repository at this point in the history
  • Loading branch information
kubanemil committed Apr 19, 2024
1 parent 0556020 commit 5e83cb9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cli/src/cluster_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2181,6 +2181,9 @@ pub fn process_calculate_rent(
data_length: usize,
use_lamports_unit: bool,
) -> ProcessResult {
if data_length > 10_000_000 {
return Err(CliError::BadParameter("Accout's maximum size is 10 MB".to_string()).into());
}
let rent_account = rpc_client.get_account(&sysvar::rent::id())?;
let rent: Rent = rent_account.deserialize_data()?;
let rent_exempt_minimum_lamports = rent.minimum_balance(data_length);
Expand Down

0 comments on commit 5e83cb9

Please sign in to comment.