diff --git a/lib/ain-ocean/src/indexer/loan_token.rs b/lib/ain-ocean/src/indexer/loan_token.rs index 10acfdb54e..4c6dafe2bf 100644 --- a/lib/ain-ocean/src/indexer/loan_token.rs +++ b/lib/ain-ocean/src/indexer/loan_token.rs @@ -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; } @@ -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(()) } diff --git a/lib/ain-ocean/src/indexer/mod.rs b/lib/ain-ocean/src/indexer/mod.rs index be80c46a26..5eeb3fedf4 100644 --- a/lib/ain-ocean/src/indexer/mod.rs +++ b/lib/ain-ocean/src/indexer/mod.rs @@ -601,7 +601,7 @@ pub fn index_block(services: &Arc, block: Block) -> 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)? } }