mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +03:00
Fix test dirs to isolate the tests (#786)
* 2 tests treading on each others dirs * rustfmt * actually use a different dir in each test... * conflicting dirs across different test files also
This commit is contained in:
parent
7f67542bc9
commit
e75eef927b
1 changed files with 8 additions and 4 deletions
|
@ -37,12 +37,14 @@ fn clean_output_dir(dir_name: &str) {
|
|||
#[test]
|
||||
fn test_various_store_indices() {
|
||||
let _ = env_logger::init();
|
||||
clean_output_dir(".grin");
|
||||
let chain_dir = ".grin_idx_1";
|
||||
clean_output_dir(chain_dir);
|
||||
|
||||
let keychain = Keychain::from_random_seed().unwrap();
|
||||
let key_id = keychain.derive_key_id(1).unwrap();
|
||||
|
||||
let chain_store = &chain::store::ChainKVStore::new(".grin".to_string()).unwrap() as &ChainStore;
|
||||
let chain_store =
|
||||
&chain::store::ChainKVStore::new(chain_dir.to_string()).unwrap() as &ChainStore;
|
||||
|
||||
global::set_mining_mode(ChainTypes::AutomatedTesting);
|
||||
let genesis = pow::mine_genesis_block(None).unwrap();
|
||||
|
@ -75,9 +77,11 @@ fn test_various_store_indices() {
|
|||
#[test]
|
||||
fn test_store_header_height() {
|
||||
let _ = env_logger::init();
|
||||
clean_output_dir(".grin");
|
||||
let chain_dir = ".grin_idx_2";
|
||||
clean_output_dir(chain_dir);
|
||||
|
||||
let chain_store = &chain::store::ChainKVStore::new(".grin".to_string()).unwrap() as &ChainStore;
|
||||
let chain_store =
|
||||
&chain::store::ChainKVStore::new(chain_dir.to_string()).unwrap() as &ChainStore;
|
||||
|
||||
let mut block_header = BlockHeader::default();
|
||||
block_header.height = 1;
|
||||
|
|
Loading…
Reference in a new issue