This commit is contained in:
Tomusdrw
2016-02-03 15:57:17 +01:00
parent 2b4653ee35
commit 8a2db83803
3 changed files with 32 additions and 22 deletions

View File

@@ -46,10 +46,10 @@ impl Drop for RandomTempPath {
}
}
#[allow(dead_code)]
#[cfg(test)]
pub struct GuardedTempResult<T> {
result: T,
temp: RandomTempPath
_temp: RandomTempPath
}
impl<T> GuardedTempResult<T> {
@@ -149,7 +149,7 @@ pub fn generate_dummy_client(block_number: u32) -> GuardedTempResult<Arc<Client>
client.import_verified_blocks(&IoChannel::disconnected());
GuardedTempResult::<Arc<Client>> {
temp: dir,
_temp: dir,
result: client
}
}
@@ -167,7 +167,7 @@ pub fn get_test_client_with_blocks(blocks: Vec<Bytes>) -> GuardedTempResult<Arc<
client.import_verified_blocks(&IoChannel::disconnected());
GuardedTempResult::<Arc<Client>> {
temp: dir,
_temp: dir,
result: client
}
}
@@ -180,7 +180,7 @@ pub fn generate_dummy_blockchain(block_number: u32) -> GuardedTempResult<BlockCh
}
GuardedTempResult::<BlockChain> {
temp: temp,
_temp: temp,
result: bc
}
}
@@ -193,7 +193,7 @@ pub fn generate_dummy_blockchain_with_extra(block_number: u32) -> GuardedTempRes
}
GuardedTempResult::<BlockChain> {
temp: temp,
_temp: temp,
result: bc
}
}
@@ -203,7 +203,7 @@ pub fn generate_dummy_empty_blockchain() -> GuardedTempResult<BlockChain> {
let bc = BlockChain::new(&create_unverifiable_block(0, H256::zero()), temp.as_path());
GuardedTempResult::<BlockChain> {
temp: temp,
_temp: temp,
result: bc
}
}
@@ -213,7 +213,7 @@ pub fn get_temp_journal_db() -> GuardedTempResult<JournalDB> {
let db = DB::open_default(temp.as_str()).unwrap();
let journal_db = JournalDB::new(db);
GuardedTempResult {
temp: temp,
_temp: temp,
result: journal_db
}
}
@@ -222,7 +222,7 @@ pub fn get_temp_state() -> GuardedTempResult<State> {
let temp = RandomTempPath::new();
let journal_db = get_temp_journal_db_in(temp.as_path());
GuardedTempResult {
temp: temp,
_temp: temp,
result: State::new(journal_db, U256::from(0u8))
}
}