Skip to content

Commit

Permalink
test: Don't do PoW if not needed
Browse files Browse the repository at this point in the history
Avoid doing the PoW-hashing to find a block hash below a threshold if
the test does not require it.
  • Loading branch information
Sword-Smith committed Jan 9, 2025
1 parent f4a564a commit 86a55cc
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 82 deletions.
3 changes: 1 addition & 2 deletions src/models/blockchain/block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,6 @@ mod block_tests {
use crate::models::state::wallet::WalletSecret;
use crate::tests::shared::invalid_block_with_transaction;
use crate::tests::shared::make_mock_block;
use crate::tests::shared::make_mock_block_with_valid_pow;
use crate::tests::shared::make_mock_transaction;
use crate::tests::shared::mock_genesis_global_state;
use crate::util_types::mutator_set::archival_mmr::ArchivalMmr;
Expand Down Expand Up @@ -1136,7 +1135,7 @@ mod block_tests {
.nth_generation_spending_key_for_tests(0)
.to_address();
let (mut block_1, _, _) =
make_mock_block_with_valid_pow(&genesis_block, None, a_recipient_address, rng.gen());
make_mock_block(&genesis_block, None, a_recipient_address, rng.gen());

block_1.kernel.body.block_mmr_accumulator = MmrAccumulator::new_from_leafs(vec![]);
let timestamp = genesis_block.kernel.header.timestamp;
Expand Down
Loading

0 comments on commit 86a55cc

Please sign in to comment.