Skip to content

Commit

Permalink
fix starcoin-node tests (#4320)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjiao authored Dec 3, 2024
1 parent 76f7f19 commit 5411d4e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
28 changes: 15 additions & 13 deletions chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ use std::{
sync::Arc,
};

#[allow(dead_code)]
static MAIN_DIRECT_SAVE_BLOCK_HASH_MAP: Lazy<BTreeMap<HashValue, (BlockExecutedData, BlockInfo)>> =
Lazy::new(|| {
let mut maps = BTreeMap::new();
Expand Down Expand Up @@ -1417,6 +1418,7 @@ impl BlockChain {
Ok(ExecutedBlock { block, block_info })
}

#[allow(unused)]
fn execute_save_directly(
storage: &dyn Store,
statedb: ChainStateDB,
Expand Down Expand Up @@ -1977,20 +1979,20 @@ impl ChainReader for BlockChain {
fn execute(&mut self, verified_block: VerifiedBlock) -> Result<ExecutedBlock> {
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(),
Expand Down
1 change: 1 addition & 0 deletions scripts/nextest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 5411d4e

Please sign in to comment.