Skip to content

Commit

Permalink
Fix RemoveOracle indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouzo committed Oct 29, 2024
1 parent 07552f7 commit 13b48f6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/ain-ocean/src/indexer/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ impl Index for RemoveOracle {
let oracle_id = ctx.tx.txid;
services.oracle.by_id.delete(&oracle_id)?;

let (_, previous) = get_previous_oracle(services, oracle_id)?;

for price_feed in &previous.price_feeds {
services.oracle_token_currency.by_id.delete(&(
price_feed.token.to_owned(),
price_feed.currency.to_owned(),
oracle_id,
))?;
if let Ok((_, previous)) = get_previous_oracle(services, oracle_id) {
for price_feed in &previous.price_feeds {
services.oracle_token_currency.by_id.delete(&(
price_feed.token.to_owned(),
price_feed.currency.to_owned(),
oracle_id,
))?;
}
}

Ok(())
Expand Down

0 comments on commit 13b48f6

Please sign in to comment.