@@ -127,10 +127,16 @@ pub fn resize_price_account(
127
127
128
128
// Check that everything is ok
129
129
check_valid_signable_account ( program_id, price_account_info) ?;
130
- let mut price_account =
131
- load_checked :: < PriceAccountWrapper > ( price_account_info, PC_VERSION ) ?;
132
- // Initialize Time Machine
133
- price_account. initialize_time_machine ( ) ?;
130
+
131
+ #[ cfg( test) ]
132
+ // Sma feature disabled except in tests
133
+ {
134
+ let mut price_account =
135
+ load_checked :: < PriceAccountWrapper > ( price_account_info, PC_VERSION ) ?;
136
+ // Initialize Time Machine
137
+ price_account. initialize_time_machine ( ) ?;
138
+ }
139
+
134
140
Ok ( ( ) )
135
141
}
136
142
PriceAccountWrapper :: MINIMUM_SIZE => Ok ( ( ) ) ,
@@ -251,8 +257,10 @@ pub fn upd_price(
251
257
}
252
258
253
259
// Try to update the aggregate
260
+ #[ allow( unused_variables) ]
254
261
let mut aggregate_updated = false ;
255
262
if clock. slot > latest_aggregate_price. pub_slot_ {
263
+ #[ allow( unused_assignments) ]
256
264
unsafe {
257
265
aggregate_updated = c_upd_aggregate (
258
266
price_account. try_borrow_mut_data ( ) ?. as_mut_ptr ( ) ,
@@ -262,11 +270,15 @@ pub fn upd_price(
262
270
}
263
271
}
264
272
265
- let account_len = price_account. try_data_len ( ) ?;
266
- if aggregate_updated && account_len == PriceAccountWrapper :: MINIMUM_SIZE {
267
- let mut price_account =
268
- load_checked :: < PriceAccountWrapper > ( price_account, cmd_args. header . version ) ?;
269
- price_account. add_price_to_time_machine ( ) ?;
273
+ #[ cfg( test) ]
274
+ // Sma feature disabled in production for now
275
+ {
276
+ let account_len = price_account. try_data_len ( ) ?;
277
+ if aggregate_updated && account_len == PriceAccountWrapper :: MINIMUM_SIZE {
278
+ let mut price_account =
279
+ load_checked :: < PriceAccountWrapper > ( price_account, cmd_args. header . version ) ?;
280
+ price_account. add_price_to_time_machine ( ) ?;
281
+ }
270
282
}
271
283
272
284
// Try to update the publisher's price
0 commit comments