@@ -10,6 +10,7 @@ use crate::c_oracle_header::{
10
10
PriceEma ,
11
11
PriceInfo ,
12
12
ProductAccount ,
13
+ PythAccount ,
13
14
MAX_CI_DIVISOR ,
14
15
PC_COMP_SIZE ,
15
16
PC_MAP_TABLE_SIZE ,
@@ -60,9 +61,6 @@ use solana_program::system_instruction::transfer;
60
61
use solana_program:: system_program:: check_id;
61
62
use solana_program:: sysvar:: Sysvar ;
62
63
63
- const PRICE_T_SIZE : usize = size_of :: < PriceAccount > ( ) ;
64
- const PRICE_ACCOUNT_SIZE : usize = size_of :: < PriceAccountWrapper > ( ) ;
65
-
66
64
67
65
#[ cfg( target_arch = "bpf" ) ]
68
66
#[ link( name = "cpyth-bpf" ) ]
@@ -116,7 +114,7 @@ pub fn resize_price_account(
116
114
}
117
115
let account_len = price_account_info. try_data_len ( ) ?;
118
116
match account_len {
119
- PRICE_T_SIZE => {
117
+ PriceAccount :: MINIMUM_SIZE => {
120
118
// Ensure account is still rent exempt after resizing
121
119
let rent: Rent = Default :: default ( ) ;
122
120
let lamports_needed: u64 = rent
@@ -142,7 +140,7 @@ pub fn resize_price_account(
142
140
price_account. initialize_time_machine ( ) ?;
143
141
Ok ( ( ) )
144
142
}
145
- PRICE_ACCOUNT_SIZE => Ok ( ( ) ) ,
143
+ PriceAccountWrapper :: MINIMUM_SIZE => Ok ( ( ) ) ,
146
144
_ => Err ( ProgramError :: InvalidArgument ) ,
147
145
}
148
146
}
@@ -264,7 +262,7 @@ pub fn upd_price(
264
262
}
265
263
266
264
let account_len = price_account. try_data_len ( ) ?;
267
- if aggregate_updated && account_len == PRICE_ACCOUNT_SIZE {
265
+ if aggregate_updated && account_len == PriceAccountWrapper :: MINIMUM_SIZE {
268
266
let mut price_account =
269
267
load_checked :: < PriceAccountWrapper > ( price_account, cmd_args. header . version ) ?;
270
268
price_account. add_price_to_time_machine ( ) ?;
0 commit comments