validator/pow: introduced fixed difficulty for testing purposes

This commit is contained in:
aggstam
2023-11-21 14:41:56 +02:00
parent 75353cb0b5
commit cb06356c46
14 changed files with 83 additions and 16 deletions

View File

@@ -41,7 +41,7 @@ struct Node {
impl Node {
fn new() -> Result<Self> {
let blockchain = Blockchain::new(&sled::Config::new().temporary(true).open()?)?;
let module = PoWModule::new(blockchain.clone(), POW_THREADS, POW_TARGET)?;
let module = PoWModule::new(blockchain.clone(), POW_THREADS, POW_TARGET, None)?;
Ok(Self { blockchain, module })
}
}
@@ -64,8 +64,8 @@ impl Harness {
}
fn validate_chains(&self) -> Result<()> {
validate_blockchain(&self.alice.blockchain, POW_THREADS, POW_TARGET)?;
validate_blockchain(&self.bob.blockchain, POW_THREADS, POW_TARGET)?;
validate_blockchain(&self.alice.blockchain, POW_THREADS, POW_TARGET, None)?;
validate_blockchain(&self.bob.blockchain, POW_THREADS, POW_TARGET, None)?;
assert_eq!(self.alice.blockchain.len(), self.bob.blockchain.len());