Skip to content

Commit 27926ef

Browse files
committed
tmp2
1 parent 38ada8a commit 27926ef

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

program/rust/src/processor.rs

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(unused_variables, unused_imports)]
12
use {
23
crate::{
34
accounts::{
@@ -118,21 +119,25 @@ fn reserve_new_price_feed_index<'a>(
118119
let new_size = PermissionAccount::MIN_SIZE_WITH_LAST_FEED_INDEX;
119120
let rent = Rent::get()?;
120121
let new_minimum_balance = rent.minimum_balance(new_size);
121-
let lamports_diff = new_minimum_balance.saturating_sub(permissions_account.lamports());
122-
if lamports_diff > 0 {
123-
invoke(
124-
&system_instruction::transfer(
125-
funding_account.key,
126-
permissions_account.key,
127-
lamports_diff,
128-
),
129-
&[
130-
funding_account.clone(),
131-
permissions_account.clone(),
132-
system_program.clone(),
133-
],
134-
)?;
135-
}
122+
pyth_assert(
123+
permissions_account.lamports() >= new_minimum_balance,
124+
OracleError::AccountTooSmall.into(),
125+
)?;
126+
// let lamports_diff = new_minimum_balance.saturating_sub(permissions_account.lamports());
127+
// if lamports_diff > 0 {
128+
// invoke(
129+
// &system_instruction::transfer(
130+
// funding_account.key,
131+
// permissions_account.key,
132+
// lamports_diff,
133+
// ),
134+
// &[
135+
// funding_account.clone(),
136+
// permissions_account.clone(),
137+
// system_program.clone(),
138+
// ],
139+
// )?;
140+
// }
136141

137142
permissions_account.realloc(new_size, true)?;
138143
let mut header = load_account_as_mut::<AccountHeader>(permissions_account)?;

0 commit comments

Comments
 (0)