@@ -130,58 +130,6 @@ fn test_add_price() {
130130 assert ! ( product_data. first_price_account == * price_account_2. key) ;
131131 }
132132
133- // Emulate pre-existing price accounts without a feed index.
134- {
135- let mut price_data = load_checked :: < PriceAccount > ( & price_account, PC_VERSION ) . unwrap ( ) ;
136- price_data. feed_index = 0 ;
137- let mut price_data_2 = load_checked :: < PriceAccount > ( & price_account_2, PC_VERSION ) . unwrap ( ) ;
138- price_data_2. feed_index = 0 ;
139- }
140- let hdr_init_price_feed_index = CommandHeader :: from ( OracleCommand :: InitPriceFeedIndex ) ;
141- let instruction_data_init_price_feed_index = bytes_of ( & hdr_init_price_feed_index) ;
142- process_instruction (
143- & program_id,
144- & [
145- funding_account. clone ( ) ,
146- price_account. clone ( ) ,
147- permissions_account. clone ( ) ,
148- ] ,
149- instruction_data_init_price_feed_index,
150- )
151- . unwrap ( ) ;
152- {
153- let price_data = load_checked :: < PriceAccount > ( & price_account, PC_VERSION ) . unwrap ( ) ;
154- assert_eq ! ( price_data. feed_index, 3 ) ;
155- }
156- process_instruction (
157- & program_id,
158- & [
159- funding_account. clone ( ) ,
160- price_account_2. clone ( ) ,
161- permissions_account. clone ( ) ,
162- ] ,
163- instruction_data_init_price_feed_index,
164- )
165- . unwrap ( ) ;
166- {
167- let price_data_2 = load_checked :: < PriceAccount > ( & price_account_2, PC_VERSION ) . unwrap ( ) ;
168- assert_eq ! ( price_data_2. feed_index, 4 ) ;
169- }
170-
171- // Feed index is already set.
172- assert_eq ! (
173- process_instruction(
174- & program_id,
175- & [
176- funding_account. clone( ) ,
177- price_account_2. clone( ) ,
178- permissions_account. clone( ) ,
179- ] ,
180- instruction_data_init_price_feed_index,
181- ) ,
182- Err ( OracleError :: FeedIndexAlreadyInitialized . into( ) )
183- ) ;
184-
185133 // Wrong number of accounts
186134 assert_eq ! (
187135 process_instruction(
0 commit comments