Skip to content

Commit

Permalink
fix sync case for dag chain
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjiao committed May 27, 2024
1 parent 7e64858 commit 1ad7c4f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
5 changes: 1 addition & 4 deletions cmd/replay/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ fn main() -> anyhow::Result<()> {
let _logger = starcoin_logger::init();
let opts: ReplayOpt = ReplayOpt::parse();

let network = match opts.net {
Some(network) => network,
None => BuiltinNetworkID::Proxima,
};
let network = opts.net.unwrap_or(BuiltinNetworkID::Proxima);
let net = ChainNetwork::new_builtin(network);

let from_dir = opts.from;
Expand Down
9 changes: 0 additions & 9 deletions config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,15 +484,6 @@ impl NodeConfig {
Self::load_with_opt(&opt).expect("Auto generate test config should success.")
}

pub fn proxima_for_test(dir: PathBuf) -> Self {
let opt = StarcoinOpt {
net: Some(BuiltinNetworkID::Proxima.into()),
base_data_dir: Some(dir),
..StarcoinOpt::default()
};
Self::load_with_opt(&opt).expect("Auto generate proxima config should success.")
}

pub fn customize_for_test() -> Self {
let opt = StarcoinOpt {
net: Some(BuiltinNetworkID::Test.into()),
Expand Down
3 changes: 2 additions & 1 deletion sync/src/tasks/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ pub async fn test_sync_invalid_target() -> Result<()> {

#[stest::test]
pub async fn test_failed_block() -> Result<()> {
let net = ChainNetwork::new_builtin(BuiltinNetworkID::Halley);
// todo: fix this test for dag chain (dag effective height is ZERO)
let net = ChainNetwork::new_builtin(BuiltinNetworkID::Test);
let (storage, chain_info, _, dag) = Genesis::init_storage_for_test(&net)?;

let chain = BlockChain::new(
Expand Down

0 comments on commit 1ad7c4f

Please sign in to comment.