|
| 1 | +#![allow(unused_variables, unused_imports)] |
1 | 2 | use {
|
2 | 3 | crate::{
|
3 | 4 | accounts::{
|
@@ -118,21 +119,25 @@ fn reserve_new_price_feed_index<'a>(
|
118 | 119 | let new_size = PermissionAccount::MIN_SIZE_WITH_LAST_FEED_INDEX;
|
119 | 120 | let rent = Rent::get()?;
|
120 | 121 | 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 | + // } |
136 | 141 |
|
137 | 142 | permissions_account.realloc(new_size, true)?;
|
138 | 143 | let mut header = load_account_as_mut::<AccountHeader>(permissions_account)?;
|
|
0 commit comments