diff --git a/core/tests/consensus.rs b/core/tests/consensus.rs index aee015de..51781c3c 100644 --- a/core/tests/consensus.rs +++ b/core/tests/consensus.rs @@ -408,17 +408,17 @@ fn next_target_adjustment() { let diff_one = Difficulty::one(); assert_eq!( next_difficulty(1, vec![HeaderInfo::from_ts_diff(cur_time, diff_one)]), - HeaderInfo::from_diff_scaling(Difficulty::one(), 1), + HeaderInfo::from_diff_scaling(Difficulty::one(), 4), ); assert_eq!( next_difficulty(1, vec![HeaderInfo::new(cur_time, diff_one, 10, true)]), - HeaderInfo::from_diff_scaling(Difficulty::one(), 1), + HeaderInfo::from_diff_scaling(Difficulty::one(), 4), ); let mut hi = HeaderInfo::from_diff_scaling(diff_one, 1); assert_eq!( next_difficulty(1, repeat(60, hi.clone(), DIFFICULTY_ADJUST_WINDOW, None)), - HeaderInfo::from_diff_scaling(Difficulty::one(), 1), + HeaderInfo::from_diff_scaling(Difficulty::one(), 4), ); hi.is_secondary = true; assert_eq!( @@ -428,7 +428,7 @@ fn next_target_adjustment() { hi.secondary_scaling = 100; assert_eq!( next_difficulty(1, repeat(60, hi.clone(), DIFFICULTY_ADJUST_WINDOW, None)), - HeaderInfo::from_diff_scaling(Difficulty::one(), 93), + HeaderInfo::from_diff_scaling(Difficulty::one(), 106), ); // Check we don't get stuck on difficulty 1 diff --git a/wallet/tests/common/mod.rs b/wallet/tests/common/mod.rs index 6afd12be..ef2f029a 100644 --- a/wallet/tests/common/mod.rs +++ b/wallet/tests/common/mod.rs @@ -97,6 +97,7 @@ pub fn add_block_with_reward(chain: &Chain, txs: Vec<&Transaction>, reward: CbDa (output, kernel), ).unwrap(); b.header.timestamp = prev.timestamp + Duration::seconds(60); + b.header.pow.scaling_difficulty = next_header_info.secondary_scaling; chain.set_txhashset_roots(&mut b, false).unwrap(); pow::pow_size( &mut b.header,