File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,10 @@ pub fn load_account_as_mut<'a, T: Pod>(
6969 } ) )
7070}
7171
72- pub fn load_checked < ' a , T : PythAccount > (
73- account : & ' a AccountInfo ,
74- version : u32 ,
72+ pub fn check_owned_and_rent_exempt_account < T : PythAccount > (
73+ account : & AccountInfo ,
7574 program_id : & Pubkey ,
76- ) -> Result < RefMut < ' a , T > , ProgramError > {
75+ ) -> Result < ( ) , ProgramError > {
7776 // Check size and rent
7877 pyth_assert (
7978 account. data_len ( ) >= T :: minimum_size ( )
@@ -84,8 +83,17 @@ pub fn load_checked<'a, T: PythAccount>(
8483 // Check owner
8584 pyth_assert (
8685 account. owner == program_id,
87- OracleError :: SmallSizeOrNotEnoughRent . into ( ) ,
86+ OracleError :: AccountNotOwnerByOracle . into ( ) ,
8887 ) ?;
88+ Ok ( ( ) )
89+ }
90+
91+ pub fn load_checked < ' a , T : PythAccount > (
92+ account : & ' a AccountInfo ,
93+ version : u32 ,
94+ program_id : & Pubkey ,
95+ ) -> Result < RefMut < ' a , T > , ProgramError > {
96+ check_owned_and_rent_exempt_account :: < T > ( account, program_id) ?;
8997
9098 // Check header
9199 {
You can’t perform that action at this time.
0 commit comments