Skip to content

Commit 863a7d8

Browse files
committed
fix: correct a typo on the ad_price and fix test script
1 parent cd6e1fc commit 863a7d8

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

program/rust/src/processor/add_price.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn add_price(
8585
price_data.min_pub_ = PRICE_ACCOUNT_DEFAULT_MIN_PUB;
8686
price_data.feed_index = reserve_new_price_feed_index(permissions_account)?;
8787

88-
if !cfg!(feature = "no-default-accumulator_v2") {
88+
if !cfg!(feature = "no-default-accumulator-v2") {
8989
price_data
9090
.flags
9191
.insert(PriceAccountFlags::ACCUMULATOR_V2 | PriceAccountFlags::MESSAGE_BUFFER_CLEARED);

program/rust/src/tests/test_publish.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ async fn test_publish() {
103103
assert_eq!(price_data.comp_[0].latest_.status_, PC_STATUS_UNKNOWN);
104104

105105
if cfg!(feature = "no-default-accumulator-v2") {
106-
assert_eq!(price_data.agg_.price_, 150);
107-
assert_eq!(price_data.agg_.conf_, 7);
108-
assert_eq!(price_data.agg_.status_, PC_STATUS_TRADING);
106+
assert_eq!(price_data.comp_[0].agg_.price_, 150);
107+
assert_eq!(price_data.comp_[0].agg_.conf_, 7);
108+
assert_eq!(price_data.comp_[0].agg_.status_, PC_STATUS_TRADING);
109109
} else {
110-
assert_eq!(price_data.agg_.price_, 0);
111-
assert_eq!(price_data.agg_.conf_, 0);
112-
assert_eq!(price_data.agg_.status_, PC_STATUS_UNKNOWN);
110+
assert_eq!(price_data.comp_[0].agg_.price_, 0);
111+
assert_eq!(price_data.comp_[0].agg_.conf_, 0);
112+
assert_eq!(price_data.comp_[0].agg_.status_, PC_STATUS_UNKNOWN);
113113
}
114114
}
115115
}

scripts/build-bpf.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ mkdir -p target/pyth/pythnet/
2828
mv target/deploy/pyth_oracle.so target/pyth/pythnet/pyth_oracle_pythnet.so
2929

3030
# Re-run tests affected by features
31-
cargo-test-bpf -- --features no-default-accumulator-v2
3231
cargo-build-bpf -- --locked -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --features no-default-accumulator-v2
32+
cargo test --locked --features no-default-accumulator-v2
3333
sha256sum ./target/**/*.so
3434
echo "Checking size of pyth_oracle.so for pythnet with no accumulator"
3535
./scripts/check-size.sh 88429

0 commit comments

Comments
 (0)