1+ #[ cfg( feature = "pythnet" ) ]
2+ use {
3+ crate :: accounts:: {
4+ PriceFeedMessage ,
5+ TwapMessage ,
6+ UPD_PRICE_WRITE_SEED ,
7+ } ,
8+ solana_program:: instruction:: {
9+ AccountMeta ,
10+ Instruction ,
11+ } ,
12+ solana_program:: program:: invoke_signed,
13+ } ;
114use {
215 crate :: {
316 accounts:: {
417 PriceAccount ,
518 PriceAccountV2 ,
6- PriceFeedMessage ,
719 PriceInfo ,
820 PythAccount ,
9- TwapMessage ,
10- UPD_PRICE_WRITE_SEED ,
1121 } ,
1222 deserialize:: {
1323 load,
@@ -28,17 +38,13 @@ use {
2838 account_info:: AccountInfo ,
2939 clock:: Clock ,
3040 entrypoint:: ProgramResult ,
31- instruction:: {
32- AccountMeta ,
33- Instruction ,
34- } ,
35- program:: invoke_signed,
3641 program_error:: ProgramError ,
3742 pubkey:: Pubkey ,
3843 sysvar:: Sysvar ,
3944 } ,
4045} ;
4146
47+
4248#[ cfg( target_arch = "bpf" ) ]
4349#[ link( name = "cpyth-bpf" ) ]
4450extern "C" {
@@ -97,6 +103,7 @@ pub fn upd_price(
97103) -> ProgramResult {
98104 let cmd_args = load :: < UpdPriceArgs > ( instruction_data) ?;
99105
106+ #[ allow( unused_variables) ]
100107 let ( funding_account, price_account, clock_account, maybe_accumulator_accounts) = match accounts
101108 {
102109 [ x, y, z] => Ok ( ( x, y, z, None ) ) ,
@@ -179,7 +186,7 @@ pub fn upd_price(
179186 price_data. message_sent_ = 0 ;
180187 }
181188
182-
189+ # [ cfg ( feature = "pythnet" ) ]
183190 if let Some ( accumulator_accounts) = maybe_accumulator_accounts {
184191 if price_data. message_sent_ == 0 {
185192 // Check that the oracle PDA is correctly configured for the program we are calling.
@@ -261,7 +268,7 @@ pub fn upd_price(
261268 Ok ( ( ) )
262269}
263270
264-
271+ # [ allow ( dead_code ) ]
265272// Wrapper struct for the accounts required to add data to the accumulator program.
266273struct MessageBufferAccounts < ' a , ' b : ' a > {
267274 program_id : & ' a AccountInfo < ' b > ,
0 commit comments