Skip to content

Commit 308c827

Browse files
committed
chore: rename variable for pyth store pid
1 parent c2270e5 commit 308c827

File tree

7 files changed

+22
-23
lines changed

7 files changed

+22
-23
lines changed

runtime/src/bank/pyth/accumulator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ lazy_static! {
5858
.parse()
5959
.unwrap(),
6060
);
61-
pub static ref BATCH_PUBLISH_PID: Pubkey = env_pubkey_or(
62-
"BATCH_PUBLISH_PID",
61+
pub static ref PRICE_STORE_PID: Pubkey = env_pubkey_or(
62+
"PRICE_STORE_PID",
6363
"3m6sv6HGqEbuyLV84mD7rJn4MAC9LhUa1y1AUNVqcPfr"
6464
.parse()
6565
.unwrap(),

runtime/src/bank/pyth/batch_publish.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use {
2-
super::accumulator::BATCH_PUBLISH_PID,
2+
super::accumulator::PRICE_STORE_PID,
33
crate::{
44
accounts_index::{IndexKey, ScanConfig, ScanError},
55
bank::Bank,
@@ -33,14 +33,14 @@ pub fn extract_batch_publish_prices(
3333
bank: &Bank,
3434
) -> Result<HashMap<u32, Vec<PublisherPriceValue>>, HandleBatchPublishError> {
3535
assert!(
36-
bank.account_indexes_include_key(&*BATCH_PUBLISH_PID),
36+
bank.account_indexes_include_key(&*PRICE_STORE_PID),
3737
"Oracle program account index missing"
3838
);
3939

4040
let publish_program_accounts = bank
4141
.get_filtered_indexed_accounts(
42-
&IndexKey::ProgramId(*BATCH_PUBLISH_PID),
43-
|account| account.owner() == &*BATCH_PUBLISH_PID,
42+
&IndexKey::ProgramId(*PRICE_STORE_PID),
43+
|account| account.owner() == &*PRICE_STORE_PID,
4444
&ScanConfig::new(true),
4545
None,
4646
)

runtime/src/bank/pyth/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use {
22
accumulator::{
3-
ACCUMULATOR_EMITTER_ADDR, ACCUMULATOR_SEQUENCE_ADDR, BATCH_PUBLISH_PID, MESSAGE_BUFFER_PID,
4-
ORACLE_PID, STAKE_CAPS_PARAMETERS_ADDR, WORMHOLE_PID,
3+
ACCUMULATOR_EMITTER_ADDR, ACCUMULATOR_SEQUENCE_ADDR, MESSAGE_BUFFER_PID, ORACLE_PID,
4+
PRICE_STORE_PID, STAKE_CAPS_PARAMETERS_ADDR, WORMHOLE_PID,
55
},
66
solana_sdk::pubkey::Pubkey,
77
};
@@ -22,6 +22,6 @@ pub fn get_pyth_keys() -> Vec<(&'static str, Pubkey)> {
2222
("WORMHOLE_PID", *WORMHOLE_PID),
2323
("ORACLE_PID", *ORACLE_PID),
2424
("STAKE_CAPS_PARAMETERS_ADDR", *STAKE_CAPS_PARAMETERS_ADDR),
25-
("BATCH_PUBLISH_PID", *BATCH_PUBLISH_PID),
25+
("PRICE_STORE_PID", *PRICE_STORE_PID),
2626
]
2727
}

runtime/src/bank/pyth/tests/accumulator_tests.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ use {
33
bank::{
44
pyth::{
55
accumulator::{
6-
ACCUMULATOR_RING_SIZE, BATCH_PUBLISH_PID, ORACLE_PID,
7-
STAKE_CAPS_PARAMETERS_ADDR,
6+
ACCUMULATOR_RING_SIZE, ORACLE_PID, PRICE_STORE_PID, STAKE_CAPS_PARAMETERS_ADDR,
87
},
98
get_pyth_keys,
109
tests::{create_new_bank_for_tests_with_index, new_from_parent},
@@ -1114,7 +1113,7 @@ fn test_get_accumulator_keys() {
11141113
Pubkey::new_from_array(pythnet::WORMHOLE_PID),
11151114
*ORACLE_PID,
11161115
*STAKE_CAPS_PARAMETERS_ADDR,
1117-
*BATCH_PUBLISH_PID,
1116+
*PRICE_STORE_PID,
11181117
];
11191118
assert_eq!(accumulator_keys, expected_pyth_keys);
11201119
}

runtime/src/bank/pyth/tests/batch_publish_tests.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use {
22
crate::{
33
bank::pyth::{
4-
accumulator::{BATCH_PUBLISH_PID, ORACLE_PID},
4+
accumulator::{ORACLE_PID, PRICE_STORE_PID},
55
tests::{create_new_bank_for_tests_with_index, new_from_parent},
66
},
77
genesis_utils::{create_genesis_config_with_leader, GenesisConfigInfo},
@@ -50,13 +50,13 @@ fn test_batch_publish() {
5050
PUBLISHER_CONFIG_SEED.as_bytes(),
5151
&publisher_key.pubkey().to_bytes(),
5252
],
53-
&BATCH_PUBLISH_PID,
53+
&PRICE_STORE_PID,
5454
);
5555
let publisher_buffer_key =
56-
Pubkey::create_with_seed(&leader_pubkey, seed2, &BATCH_PUBLISH_PID).unwrap();
56+
Pubkey::create_with_seed(&leader_pubkey, seed2, &PRICE_STORE_PID).unwrap();
5757

5858
let mut publisher_config_account =
59-
AccountSharedData::new(42, publisher_config::SIZE, &BATCH_PUBLISH_PID);
59+
AccountSharedData::new(42, publisher_config::SIZE, &PRICE_STORE_PID);
6060

6161
publisher_config::create(
6262
publisher_config_account.data_mut(),
@@ -67,7 +67,7 @@ fn test_batch_publish() {
6767
bank.store_account(&publisher_config_key, &publisher_config_account);
6868

6969
let mut publisher_buffer_account =
70-
AccountSharedData::new(42, buffer::size(100), &BATCH_PUBLISH_PID);
70+
AccountSharedData::new(42, buffer::size(100), &PRICE_STORE_PID);
7171
{
7272
let (header, prices) = buffer::create(
7373
publisher_buffer_account.data_mut(),

runtime/src/bank/pyth/tests/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use {
2-
super::accumulator::{BATCH_PUBLISH_PID, MESSAGE_BUFFER_PID, ORACLE_PID},
2+
super::accumulator::{MESSAGE_BUFFER_PID, ORACLE_PID, PRICE_STORE_PID},
33
crate::{
44
accounts_db::AccountShrinkThreshold,
55
accounts_index::{
@@ -24,7 +24,7 @@ fn create_new_bank_for_tests_with_index(genesis_config: &GenesisConfig) -> Bank
2424
AccountSecondaryIndexes {
2525
keys: Some(AccountSecondaryIndexesIncludeExclude {
2626
exclude: false,
27-
keys: [*ORACLE_PID, *MESSAGE_BUFFER_PID, *BATCH_PUBLISH_PID]
27+
keys: [*ORACLE_PID, *MESSAGE_BUFFER_PID, *PRICE_STORE_PID]
2828
.into_iter()
2929
.collect(),
3030
}),

validator/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use {
5252
AccountIndex, AccountSecondaryIndexes, AccountSecondaryIndexesIncludeExclude,
5353
AccountsIndexConfig, IndexLimitMb,
5454
},
55-
bank::pyth::accumulator::{BATCH_PUBLISH_PID, MESSAGE_BUFFER_PID, ORACLE_PID},
55+
bank::pyth::accumulator::{MESSAGE_BUFFER_PID, ORACLE_PID, PRICE_STORE_PID},
5656
hardened_unpack::MAX_GENESIS_ARCHIVE_UNPACKED_SIZE,
5757
runtime_config::RuntimeConfig,
5858
snapshot_config::SnapshotConfig,
@@ -3203,19 +3203,19 @@ fn process_account_indexes(matches: &ArgMatches) -> AccountSecondaryIndexes {
32033203
if include_keys
32043204
&& (!account_indexes_include_keys.contains(&*ORACLE_PID)
32053205
|| !account_indexes_include_keys.contains(&*MESSAGE_BUFFER_PID)
3206-
|| !account_indexes_include_keys.contains(&*BATCH_PUBLISH_PID))
3206+
|| !account_indexes_include_keys.contains(&*PRICE_STORE_PID))
32073207
{
32083208
panic!(
32093209
"The oracle program id and message buffer program id must be included in the account index. Add the following flags\n\
32103210
--account-index-include-key {}\n\
32113211
--account-index-include-key {}\n\
32123212
--account-index-include-key {}\n",
3213-
&*ORACLE_PID, &*MESSAGE_BUFFER_PID, &*BATCH_PUBLISH_PID,
3213+
&*ORACLE_PID, &*MESSAGE_BUFFER_PID, &*PRICE_STORE_PID,
32143214
);
32153215
}
32163216

32173217
if exclude_keys {
3218-
for key in &[&*ORACLE_PID, &*MESSAGE_BUFFER_PID, &*BATCH_PUBLISH_PID] {
3218+
for key in &[&*ORACLE_PID, &*MESSAGE_BUFFER_PID, &*PRICE_STORE_PID] {
32193219
if account_indexes_exclude_keys.contains(key) {
32203220
panic!(
32213221
"This key must *not* be excluded from the account index: {}",

0 commit comments

Comments
 (0)