Skip to content

Commit f44eecb

Browse files
committed
address comments
1 parent f0b7d91 commit f44eecb

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

program/rust/src/tests/test_twap.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ fn test_twap_unit() {
208208
price_cumulative_overflow.num_down_slots,
209209
u64::MAX - u64::from(u8::MAX)
210210
);
211-
// u64::MAX - u64::from(u8::MAX)
212211
assert_eq!(price_cumulative_overflow.unused, 0);
213212

214213
let mut price_cumulative_nonzero_max_latency = PriceCumulative {

program/rust/src/tests/test_upd_aggregate.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -280,38 +280,6 @@ fn test_upd_aggregate() {
280280
assert_eq!(price_data.prev_timestamp_, 5);
281281
}
282282

283-
// // check max_latency_ = 0 defaults to PC_MAX_SEND_LATENCY
284-
// {
285-
// let mut price_data = load_checked::<PriceAccount>(&price_account, PC_VERSION).unwrap();
286-
// price_data.num_ = 1;
287-
// price_data.agg_.pub_slot_ = 1050;
288-
// price_data.comp_[0].latest_ = p5;
289-
// }
290-
291-
// unsafe {
292-
// assert!(c_upd_aggregate(
293-
// price_account.try_borrow_mut_data().unwrap().as_mut_ptr(),
294-
// 1051,
295-
// 13,
296-
// ));
297-
// }
298-
299-
// {
300-
// let price_data = load_checked::<PriceAccount>(&price_account, PC_VERSION).unwrap();
301-
302-
// assert_eq!(price_data.max_latency_, 0);
303-
// assert_eq!(price_data.agg_.price_, 500);
304-
// assert_eq!(price_data.agg_.conf_, 50);
305-
// assert_eq!(price_data.twap_.val_, 177);
306-
// assert_eq!(price_data.twac_.val_, 34);
307-
// assert_eq!(price_data.num_qt_, 1);
308-
// assert_eq!(price_data.timestamp_, 13);
309-
// assert_eq!(price_data.prev_slot_, 1025);
310-
// assert_eq!(price_data.prev_price_, 245);
311-
// assert_eq!(price_data.prev_conf_, 85);
312-
// assert_eq!(price_data.prev_timestamp_, 5);
313-
// }
314-
315283
// ensure the update occurs within the PC_MAX_SEND_LATENCY limit of 25 slots, allowing the aggregated price to reflect both p4 and p5 contributions
316284
{
317285
let mut price_data = load_checked::<PriceAccount>(&price_account, PC_VERSION).unwrap();
@@ -336,8 +304,6 @@ fn test_upd_aggregate() {
336304
assert_eq!(price_data.max_latency_, 0);
337305
assert_eq!(price_data.agg_.price_, 445);
338306
assert_eq!(price_data.agg_.conf_, 55);
339-
assert_eq!(price_data.twap_.val_, 168);
340-
assert_eq!(price_data.twac_.val_, 35);
341307
assert_eq!(price_data.num_qt_, 2);
342308
assert_eq!(price_data.timestamp_, 13);
343309
assert_eq!(price_data.prev_slot_, 1025);
@@ -361,8 +327,6 @@ fn test_upd_aggregate() {
361327
assert_eq!(price_data.max_latency_, 0);
362328
assert_eq!(price_data.agg_.price_, 500);
363329
assert_eq!(price_data.agg_.conf_, 50);
364-
assert_eq!(price_data.twap_.val_, 203);
365-
assert_eq!(price_data.twac_.val_, 36);
366330
assert_eq!(price_data.num_qt_, 1);
367331
assert_eq!(price_data.timestamp_, 14);
368332
assert_eq!(price_data.prev_slot_, 1025);
@@ -398,8 +362,6 @@ fn test_upd_aggregate() {
398362
assert_eq!(price_data.agg_.status_, PC_STATUS_UNKNOWN);
399363
assert_eq!(price_data.agg_.price_, 500);
400364
assert_eq!(price_data.agg_.conf_, 50);
401-
assert_eq!(price_data.twap_.val_, 203);
402-
assert_eq!(price_data.twac_.val_, 36);
403365
assert_eq!(price_data.num_qt_, 0);
404366
assert_eq!(price_data.timestamp_, 15);
405367
assert_eq!(price_data.prev_slot_, 1000);

0 commit comments

Comments
 (0)