File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -88,22 +88,26 @@ pub fn pre_log(accounts: &[AccountInfo], instruction_data: &[u8]) -> ProgramResu
8888
8989pub fn post_log ( c_ret_val : u64 , accounts : & [ AccountInfo ] ) -> ProgramResult {
9090 if c_ret_val == SUCCESSFULLY_UPDATED_AGGREGATE {
91- let start : usize = PRICE_T_AGGREGATE_OFFSET
91+ let aggregate_price_start : usize = PRICE_T_AGGREGATE_OFFSET
9292 . try_into ( )
9393 . map_err ( |_| OracleError :: Generic ) ?;
9494 // We trust that the C oracle has properly checked this account
9595 let aggregate_price_info: pc_price_info = pc_price_info:: try_from_slice (
9696 & accounts
9797 . get ( 1 )
9898 . ok_or ( OracleError :: Generic ) ?
99- . try_borrow_data ( ) ?[ start ..( start + size_of :: < pc_price_info > ( ) ) ] ,
99+ . try_borrow_data ( ) ?[ aggregate_price_start ..( aggregate_price_start + size_of :: < pc_price_info > ( ) ) ] ,
100100 ) ?;
101101
102+ let ema_start: usize = PRICE_T_EMA_OFFSET
103+ . try_into ( )
104+ . map_err ( |_| OracleError :: Generic ) ?;
105+
102106 let ema_info: pc_ema = pc_ema:: try_from_slice (
103107 & accounts
104108 . get ( 1 )
105109 . ok_or ( OracleError :: Generic ) ?
106- . try_borrow_data ( ) ?[ start ..( start + size_of :: < pc_ema > ( ) ) ] ,
110+ . try_borrow_data ( ) ?[ ema_start ..( ema_start + size_of :: < pc_ema > ( ) ) ] ,
107111 ) ?;
108112
109113 let clock = Clock :: get ( ) ?;
You can’t perform that action at this time.
0 commit comments