Skip to content

Commit

Permalink
fix test case for forking main
Browse files Browse the repository at this point in the history
  • Loading branch information
sanlee42 committed Jan 19, 2024
1 parent 6f5d331 commit a720253
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sync/src/block_connector/test_write_dag_block_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ fn gen_fork_dag_block_chain(
writeable_block_chain_service: &mut WriteBlockChainService<MockTxPoolService>,
) -> Option<HashValue> {
let miner_account = AccountInfo::random();
let dag = BlockDAG::create_for_testing().unwrap();
let dag = writeable_block_chain_service.get_dag();
if let Some(block_header) = writeable_block_chain_service
.get_main()
.get_header_by_number(fork_number)
Expand Down
4 changes: 4 additions & 0 deletions sync/src/block_connector/write_block_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ where
&self.main
}

pub fn get_dag(&self) -> BlockDAG {
self.dag.clone()
}

#[cfg(test)]
pub fn create_block(
&self,
Expand Down

0 comments on commit a720253

Please sign in to comment.