database drop
This commit is contained in:
parent
82189b7426
commit
b67f33ce5b
|
@ -25,10 +25,8 @@ pub fn main(benchmark: &mut Benchmark) {
|
||||||
|
|
||||||
// test setup
|
// test setup
|
||||||
let path = RandomTempPath::create_dir();
|
let path = RandomTempPath::create_dir();
|
||||||
let store = Arc::new(Storage::new(path.as_path()).unwrap());
|
|
||||||
|
|
||||||
let genesis = test_data::genesis();
|
let genesis = test_data::genesis();
|
||||||
store.insert_block(&genesis).unwrap();
|
|
||||||
|
|
||||||
let mut rolling_hash = genesis.hash();
|
let mut rolling_hash = genesis.hash();
|
||||||
let mut blocks: Vec<IndexedBlock> = Vec::new();
|
let mut blocks: Vec<IndexedBlock> = Vec::new();
|
||||||
|
@ -52,7 +50,12 @@ pub fn main(benchmark: &mut Benchmark) {
|
||||||
rolling_hash = next_block.hash();
|
rolling_hash = next_block.hash();
|
||||||
blocks.push(next_block.into());
|
blocks.push(next_block.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
let store = Arc::new(Storage::new(path.as_path()).unwrap());
|
||||||
|
store.insert_block(&genesis).unwrap();
|
||||||
for block in blocks.iter() { store.insert_indexed_block(block).unwrap(); }
|
for block in blocks.iter() { store.insert_indexed_block(block).unwrap(); }
|
||||||
|
}
|
||||||
|
|
||||||
let mut verification_blocks: Vec<IndexedBlock> = Vec::new();
|
let mut verification_blocks: Vec<IndexedBlock> = Vec::new();
|
||||||
for b in 0..BLOCKS {
|
for b in 0..BLOCKS {
|
||||||
|
@ -81,6 +84,9 @@ pub fn main(benchmark: &mut Benchmark) {
|
||||||
verification_blocks.push(builder.merkled_header().parent(rolling_hash.clone()).build().build().into());
|
verification_blocks.push(builder.merkled_header().parent(rolling_hash.clone()).build().build().into());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let store = Arc::new(Storage::new(path.as_path()).unwrap());
|
||||||
|
|
||||||
let chain_verifier = ChainVerifier::new(store.clone(), Magic::Mainnet).pow_skip();
|
let chain_verifier = ChainVerifier::new(store.clone(), Magic::Mainnet).pow_skip();
|
||||||
|
|
||||||
// bench
|
// bench
|
||||||
|
|
Loading…
Reference in New Issue