ongoing experiments

This commit is contained in:
NikVolf 2016-12-14 19:44:42 +01:00
parent a3637c8432
commit d6e001089a
2 changed files with 12 additions and 2 deletions

View File

@ -6,6 +6,7 @@ extern crate time;
extern crate verification;
extern crate network;
extern crate byteorder;
extern crate primitives;
mod database;
mod verifier;

View File

@ -1,11 +1,12 @@
use std::sync::Arc;
use devtools::RandomTempPath;
use db::{Storage, BlockStapler};
use db::{Storage, BlockStapler, Store};
use chain::IndexedBlock;
use verification::{BackwardsCompatibleChainVerifier as ChainVerifier, Verify};
use network::Magic;
use test_data;
use byteorder::{LittleEndian, ByteOrder};
use primitives::Compact;
use super::Benchmark;
@ -84,11 +85,19 @@ pub fn main(benchmark: &mut Benchmark) {
builder = tx_builder.output().value(0).build().build()
}
verification_blocks.push(builder.merkled_header().parent(rolling_hash.clone()).build().build().into());
verification_blocks.push(
builder
.merkled_header()
.parent(rolling_hash.clone())
.bits(Compact::new(486604799))
.build()
.build()
.into());
}
let store = Arc::new(Storage::new(path.as_path()).unwrap());
assert_eq!(store.best_block().unwrap().hash, rolling_hash);
let chain_verifier = ChainVerifier::new(store.clone(), Magic::Mainnet).pow_skip();