Skip to content

Commit

Permalink
update oracle invalidate function
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarajm22 committed Jul 16, 2024
1 parent 051b569 commit df2a711
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/ain-ocean/src/indexer/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ impl Index for AppointOracle {
context.block.height,
context.tx.txid,
))?;
services.oracle_history.by_key.delete(&(oracle_id))?;
for currency_pair in self.price_feeds.as_ref().iter() {
let token_currency_id = (
currency_pair.token.to_owned(),
Expand Down Expand Up @@ -204,6 +205,11 @@ impl Index for RemoveOracle {
.oracle_token_currency
.by_id
.put(&oracle_token_currency.id, &oracle_token_currency)?;

services
.oracle_token_currency
.by_key
.put(&oracle_token_currency.key, &oracle_token_currency.id)?;
}
}
}
Expand Down

0 comments on commit df2a711

Please sign in to comment.