Skip to content

Commit c395b7a

Browse files
author
Jayant Krishnamurthy
committed
fix tests
1 parent 72b9912 commit c395b7a

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

program/rust/src/tests/pyth_simulator.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::mem::size_of;
2-
use std::path::Path;
32

43
use bytemuck::{
54
bytes_of,
@@ -15,7 +14,6 @@ use solana_program::rent::Rent;
1514
use solana_program::system_instruction;
1615
use solana_program_test::{
1716
processor,
18-
read_file,
1917
BanksClient,
2018
BanksClientError,
2119
ProgramTest,

program/rust/src/tests/test_upd_price.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ fn test_upd_price() {
211211
assert_eq!(price_data.agg_.status_, PC_STATUS_TRADING);
212212
}
213213

214-
populate_instruction(&mut instruction_data, 50, 6, 5);
214+
populate_instruction(&mut instruction_data, 50, 20, 5);
215215
update_clock_slot(&mut clock_account, 6);
216216

217217
// Publishing a wide CI results in a status of unknown.
@@ -236,7 +236,7 @@ fn test_upd_price() {
236236
{
237237
let price_data = load_checked::<pc_price_t>(&price_account, PC_VERSION).unwrap();
238238
assert_eq!(price_data.comp_[0].latest_.price_, 50);
239-
assert_eq!(price_data.comp_[0].latest_.conf_, 6);
239+
assert_eq!(price_data.comp_[0].latest_.conf_, 20);
240240
assert_eq!(price_data.comp_[0].latest_.pub_slot_, 5);
241241
assert_eq!(price_data.comp_[0].latest_.status_, PC_STATUS_UNKNOWN);
242242
assert_eq!(price_data.valid_slot_, 5);
@@ -246,7 +246,7 @@ fn test_upd_price() {
246246
}
247247

248248
// Crank one more time and aggregate should be unknown
249-
populate_instruction(&mut instruction_data, 50, 6, 6);
249+
populate_instruction(&mut instruction_data, 50, 20, 6);
250250
update_clock_slot(&mut clock_account, 7);
251251

252252
assert!(upd_price(
@@ -263,7 +263,7 @@ fn test_upd_price() {
263263
{
264264
let price_data = load_checked::<pc_price_t>(&price_account, PC_VERSION).unwrap();
265265
assert_eq!(price_data.comp_[0].latest_.price_, 50);
266-
assert_eq!(price_data.comp_[0].latest_.conf_, 6);
266+
assert_eq!(price_data.comp_[0].latest_.conf_, 20);
267267
assert_eq!(price_data.comp_[0].latest_.pub_slot_, 6);
268268
assert_eq!(price_data.comp_[0].latest_.status_, PC_STATUS_UNKNOWN);
269269
assert_eq!(price_data.valid_slot_, 6);

program/rust/src/tests/test_upd_price_no_fail_on_error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fn test_upd_price_no_fail_on_error_no_fail_on_error() {
114114
assert_eq!(price_data.comp_[0].latest_.price_, 42);
115115
assert_eq!(price_data.comp_[0].latest_.conf_, 9);
116116
assert_eq!(price_data.comp_[0].latest_.pub_slot_, 1);
117-
assert_eq!(price_data.comp_[0].latest_.status_, PC_STATUS_UNKNOWN);
117+
assert_eq!(price_data.comp_[0].latest_.status_, PC_STATUS_TRADING);
118118
assert_eq!(price_data.valid_slot_, 0);
119119
assert_eq!(price_data.agg_.pub_slot_, 1);
120120
assert_eq!(price_data.agg_.price_, 0);
@@ -155,7 +155,7 @@ fn test_upd_price_no_fail_on_error_no_fail_on_error() {
155155
assert_eq!(price_data.comp_[0].latest_.price_, 42);
156156
assert_eq!(price_data.comp_[0].latest_.conf_, 9);
157157
assert_eq!(price_data.comp_[0].latest_.pub_slot_, 1);
158-
assert_eq!(price_data.comp_[0].latest_.status_, PC_STATUS_UNKNOWN);
158+
assert_eq!(price_data.comp_[0].latest_.status_, PC_STATUS_TRADING);
159159
assert_eq!(price_data.valid_slot_, 0);
160160
assert_eq!(price_data.agg_.pub_slot_, 1);
161161
assert_eq!(price_data.agg_.price_, 0);

0 commit comments

Comments
 (0)