From 5411d4ec309840c73720cd1409901d0f1fae7cff Mon Sep 17 00:00:00 2001 From: simonjiao Date: Tue, 3 Dec 2024 19:48:35 +0800 Subject: [PATCH] fix starcoin-node tests (#4320) --- chain/src/chain.rs | 28 +++++++++++++++------------- scripts/nextest.sh | 1 + 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/chain/src/chain.rs b/chain/src/chain.rs index 7e1f8c9ff8..017774d6b5 100644 --- a/chain/src/chain.rs +++ b/chain/src/chain.rs @@ -57,6 +57,7 @@ use std::{ sync::Arc, }; +#[allow(dead_code)] static MAIN_DIRECT_SAVE_BLOCK_HASH_MAP: Lazy> = Lazy::new(|| { let mut maps = BTreeMap::new(); @@ -1417,6 +1418,7 @@ impl BlockChain { Ok(ExecutedBlock { block, block_info }) } + #[allow(unused)] fn execute_save_directly( storage: &dyn Store, statedb: ChainStateDB, @@ -1977,20 +1979,20 @@ impl ChainReader for BlockChain { fn execute(&mut self, verified_block: VerifiedBlock) -> Result { let header = verified_block.0.header().clone(); if self.check_chain_type()? == ChainType::Single { - let executed = if let Some((executed_data, block_info)) = - MAIN_DIRECT_SAVE_BLOCK_HASH_MAP.get(&verified_block.0.header.id()) + let executed = //if let Some((executed_data, block_info)) = + //MAIN_DIRECT_SAVE_BLOCK_HASH_MAP.get(&verified_block.0.header.id()) { - Self::execute_save_directly( - self.storage.as_ref(), - self.statedb.fork(), - self.txn_accumulator.fork(None), - self.block_accumulator.fork(None), - Some(self.status.status.clone()), - verified_block.0, - block_info.clone(), - executed_data.clone(), - )? - } else { + //Self::execute_save_directly( + // self.storage.as_ref(), + // self.statedb.fork(), + // self.txn_accumulator.fork(None), + // self.block_accumulator.fork(None), + // Some(self.status.status.clone()), + // verified_block.0, + // block_info.clone(), + // executed_data.clone(), + //)? + //} else { Self::execute_block_and_save( self.storage.as_ref(), self.statedb.fork(), diff --git a/scripts/nextest.sh b/scripts/nextest.sh index e6034d0fa4..333f987ced 100755 --- a/scripts/nextest.sh +++ b/scripts/nextest.sh @@ -26,6 +26,7 @@ cargo nextest run \ -p starcoin-executor \ -p starcoin-vm-runtime \ -p starcoin-genesis \ +-p starcoin-node \ --retries 2 --build-jobs 8 --test-threads 12 --no-fail-fast --failure-output immediate-final