Skip to content

Commit 68cf5be

Browse files
committed
remove checks
1 parent 3305c0c commit 68cf5be

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

programs/system/src/instructions/create_account.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,7 @@ impl<'a> CreateAccount<'a> {
4040
) -> Result<Self, ProgramError> {
4141
let rent = Rent::from_account_info(rent_sysvar)?;
4242
let lamports = rent.minimum_balance(space as usize);
43-
44-
if from.lamports() < lamports {
45-
return Err(ProgramError::InsufficientFunds);
46-
}
47-
48-
if !to.data_is_empty() {
49-
return Err(ProgramError::InvalidAccountData);
50-
}
51-
43+
5244
Ok(Self {
5345
from,
5446
to,

programs/system/src/instructions/create_account_with_seed.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use pinocchio::{
33
instruction::{AccountMeta, Instruction, Signer},
44
program::invoke_signed,
55
program_error::ProgramError,
6-
pubkey::{Pubkey, MAX_SEED_LEN},
6+
pubkey::Pubkey,
77
sysvars::rent::Rent,
88
ProgramResult,
99
};
@@ -55,18 +55,6 @@ impl<'a, 'b, 'c> CreateAccountWithSeed<'a, 'b, 'c> {
5555
let rent = Rent::from_account_info(rent_sysvar)?;
5656
let lamports = rent.minimum_balance(space as usize);
5757

58-
if seed.len() > MAX_SEED_LEN {
59-
return Err(ProgramError::InvalidInstructionData);
60-
}
61-
62-
if from.lamports() < lamports {
63-
return Err(ProgramError::InsufficientFunds);
64-
}
65-
66-
if !to.data_is_empty() {
67-
return Err(ProgramError::InvalidAccountData);
68-
}
69-
7058
Ok(Self {
7159
from,
7260
to,

0 commit comments

Comments
 (0)