Skip to content

Commit

Permalink
opt
Browse files Browse the repository at this point in the history
  • Loading branch information
canonbrother committed Oct 25, 2024
1 parent 3b90b85 commit b9fd69c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/ain-ocean/src/indexer/loan_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn is_aggregate_valid(aggregate: &OraclePriceAggregated, block: &BlockContext) -
return false;
}

if aggregate.aggregated.weightage == dec!(0) {
if aggregate.aggregated.weightage <= dec!(0) {
return false;
}

Expand Down Expand Up @@ -197,8 +197,7 @@ pub fn perform_active_price_tick(

let active_price = map_active_price(block, aggregated_price, prev_price);

let new_id = (id.0, id.1, block.height);
repo.by_id.put(&new_id, &active_price)?;
repo.by_id.put(&(id.0, id.1, block.height), &active_price)?;

Ok(())
}
2 changes: 1 addition & 1 deletion lib/ain-ocean/src/indexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ pub fn index_block(services: &Arc<Services>, block: Block<Transaction>) -> Resul

// index_block_end
for (dftx, _) in dftxs {
if let DfTx::SetLoanToken(data) = dftx.clone() {
if let DfTx::SetLoanToken(data) = dftx {
data.index_block_end(services, &block_ctx)?
}
}
Expand Down

0 comments on commit b9fd69c

Please sign in to comment.