Skip to content

Commit e466866

Browse files
committed
indexing_block_end implementation
1 parent 3314ca8 commit e466866

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

lib/ain-ocean/src/indexer/loan_token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rust_decimal_macros::dec;
88
use crate::{
99
indexer::{Context, Index, Result},
1010
model::{
11-
OraclePriceActive, OraclePriceActiveActive, OraclePriceActiveActiveOracles,
11+
BlockContext, OraclePriceActive, OraclePriceActiveActive, OraclePriceActiveActiveOracles,
1212
OraclePriceActiveNext, OraclePriceActiveNextOracles, OraclePriceAggregated,
1313
},
1414
repository::RepositoryOps,

lib/ain-ocean/src/indexer/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub mod helper;
1313
use std::{collections::HashMap, sync::Arc, time::Instant};
1414

1515
use std::{sync::Arc, time::Instant};
16-
use crate::indexer::loan_token::invalidate_block_end;
16+
1717
use ain_dftx::{deserialize, is_skipped_tx, DfTx, Stack};
1818
use defichain_rpc::json::blockchain::{Block, Transaction, Vin, VinStandard};
1919
use helper::check_if_evm_tx;
@@ -492,7 +492,6 @@ pub fn index_block(services: &Arc<Services>, block: Block<Transaction>) -> Resul
492492
if is_skipped_tx(&tx.txid) {
493493
continue;
494494
}
495-
496495
let start = Instant::now();
497496
let ctx = Context {
498497
block: block_ctx.clone(),
@@ -553,11 +552,11 @@ pub fn index_block(services: &Arc<Services>, block: Block<Transaction>) -> Resul
553552
median_time: block.mediantime,
554553
transaction_count,
555554
difficulty: block.difficulty,
556-
masternode: block.masternode,
557-
minter: block.minter,
555+
masternode: block.masternode.clone(),
556+
minter: block.minter.clone(),
558557
minter_block_count: block.minted_blocks,
559558
stake_modifier: block.stake_modifier.to_owned(),
560-
merkleroot: block.merkleroot,
559+
merkleroot: block.merkleroot.clone(),
561560
size: block.size,
562561
size_stripped: block.strippedsize,
563562
weight: block.weight,
@@ -570,11 +569,12 @@ pub fn index_block(services: &Arc<Services>, block: Block<Transaction>) -> Resul
570569
.by_height
571570
.put(&block_ctx.height, &block_hash)?;
572571

572+
//index block end
573+
// index_block_end(services, &block)?;
574+
573575
Ok(())
574576
}
575577

576-
pub fn invalidate_block(services: &Arc<Services>,_block: Block<Transaction>) -> Result<()> {
577-
invalidate_block_end(services,_block)?;
578-
invalidate_(services,_block)?;
578+
pub fn invalidate_block(_services: &Arc<Services>, _block: Block<Transaction>) -> Result<()> {
579579
Ok(())
580580
}

0 commit comments

Comments
 (0)