X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=rust-lightning;a=blobdiff_plain;f=lightning%2Fsrc%2Futil%2Ftest_utils.rs;fp=lightning%2Fsrc%2Futil%2Ftest_utils.rs;h=a9a10451b2c1dd0825a2f985e13075c45b759961;hp=fbd5a26d9f327de34bf60ce0ed8d3cc35ff56406;hb=0dfcacd22c23f69b6526c9c6507d21427a2b7ccb;hpb=bee9a1e4030e04a91a2d774784a2e2fc545ae797 diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs index fbd5a26d..a9a10451 100644 --- a/lightning/src/util/test_utils.rs +++ b/lightning/src/util/test_utils.rs @@ -37,6 +37,7 @@ use bitcoin::secp256k1::recovery::RecoverableSignature; use regex; +use io; use prelude::*; use core::time::Duration; use sync::{Mutex, Arc}; @@ -46,7 +47,7 @@ use chain::keysinterface::InMemorySigner; pub struct TestVecWriter(pub Vec); impl Writer for TestVecWriter { - fn write_all(&mut self, buf: &[u8]) -> Result<(), ::std::io::Error> { + fn write_all(&mut self, buf: &[u8]) -> Result<(), io::Error> { self.0.extend_from_slice(buf); Ok(()) } @@ -75,7 +76,7 @@ impl keysinterface::KeysInterface for OnlyReadsKeysInterface { fn get_secure_random_bytes(&self) -> [u8; 32] { [0; 32] } fn read_chan_signer(&self, reader: &[u8]) -> Result { - EnforcingSigner::read(&mut std::io::Cursor::new(reader)) + EnforcingSigner::read(&mut io::Cursor::new(reader)) } fn sign_invoice(&self, _invoice_preimage: Vec) -> Result { unreachable!(); } } @@ -114,7 +115,7 @@ impl<'a> chain::Watch for TestChainMonitor<'a> { let mut w = TestVecWriter(Vec::new()); monitor.write(&mut w).unwrap(); let new_monitor = <(BlockHash, channelmonitor::ChannelMonitor)>::read( - &mut ::std::io::Cursor::new(&w.0), self.keys_manager).unwrap().1; + &mut io::Cursor::new(&w.0), self.keys_manager).unwrap().1; assert!(new_monitor == monitor); self.latest_monitor_update_id.lock().unwrap().insert(funding_txo.to_channel_id(), (funding_txo, monitor.get_latest_update_id())); self.added_monitors.lock().unwrap().push((funding_txo, monitor)); @@ -136,7 +137,7 @@ impl<'a> chain::Watch for TestChainMonitor<'a> { let mut w = TestVecWriter(Vec::new()); update.write(&mut w).unwrap(); assert!(channelmonitor::ChannelMonitorUpdate::read( - &mut ::std::io::Cursor::new(&w.0)).unwrap() == update); + &mut io::Cursor::new(&w.0)).unwrap() == update); if let Some(exp) = self.expect_channel_force_closed.lock().unwrap().take() { assert_eq!(funding_txo.to_channel_id(), exp.0); @@ -155,7 +156,7 @@ impl<'a> chain::Watch for TestChainMonitor<'a> { w.0.clear(); monitor.write(&mut w).unwrap(); let new_monitor = <(BlockHash, channelmonitor::ChannelMonitor)>::read( - &mut ::std::io::Cursor::new(&w.0), self.keys_manager).unwrap().1; + &mut io::Cursor::new(&w.0), self.keys_manager).unwrap().1; assert!(new_monitor == *monitor); self.added_monitors.lock().unwrap().push((funding_txo, new_monitor)); @@ -481,7 +482,7 @@ impl keysinterface::KeysInterface for TestKeysInterface { } fn read_chan_signer(&self, buffer: &[u8]) -> Result { - let mut reader = std::io::Cursor::new(buffer); + let mut reader = io::Cursor::new(buffer); let inner: InMemorySigner = Readable::read(&mut reader)?; let revoked_commitment = self.make_revoked_commitment_cell(inner.commitment_seed);