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
+ } ;
1
14
use {
2
15
crate :: {
3
16
accounts:: {
4
17
PriceAccount ,
5
18
PriceAccountV2 ,
6
- PriceFeedMessage ,
7
19
PriceInfo ,
8
20
PythAccount ,
9
- TwapMessage ,
10
- UPD_PRICE_WRITE_SEED ,
11
21
} ,
12
22
deserialize:: {
13
23
load,
@@ -28,17 +38,13 @@ use {
28
38
account_info:: AccountInfo ,
29
39
clock:: Clock ,
30
40
entrypoint:: ProgramResult ,
31
- instruction:: {
32
- AccountMeta ,
33
- Instruction ,
34
- } ,
35
- program:: invoke_signed,
36
41
program_error:: ProgramError ,
37
42
pubkey:: Pubkey ,
38
43
sysvar:: Sysvar ,
39
44
} ,
40
45
} ;
41
46
47
+
42
48
#[ cfg( target_arch = "bpf" ) ]
43
49
#[ link( name = "cpyth-bpf" ) ]
44
50
extern "C" {
@@ -97,6 +103,7 @@ pub fn upd_price(
97
103
) -> ProgramResult {
98
104
let cmd_args = load :: < UpdPriceArgs > ( instruction_data) ?;
99
105
106
+ #[ allow( unused_variables) ]
100
107
let ( funding_account, price_account, clock_account, maybe_accumulator_accounts) = match accounts
101
108
{
102
109
[ x, y, z] => Ok ( ( x, y, z, None ) ) ,
@@ -179,7 +186,7 @@ pub fn upd_price(
179
186
price_data. message_sent_ = 0 ;
180
187
}
181
188
182
-
189
+ # [ cfg ( feature = "pythnet" ) ]
183
190
if let Some ( accumulator_accounts) = maybe_accumulator_accounts {
184
191
if price_data. message_sent_ == 0 {
185
192
// Check that the oracle PDA is correctly configured for the program we are calling.
@@ -261,7 +268,7 @@ pub fn upd_price(
261
268
Ok ( ( ) )
262
269
}
263
270
264
-
271
+ # [ allow ( dead_code ) ]
265
272
// Wrapper struct for the accounts required to add data to the accumulator program.
266
273
struct MessageBufferAccounts < ' a , ' b : ' a > {
267
274
program_id : & ' a AccountInfo < ' b > ,
0 commit comments