diff --git a/chain/src/chain.rs b/chain/src/chain.rs index b682522cd..81c147109 100644 --- a/chain/src/chain.rs +++ b/chain/src/chain.rs @@ -610,7 +610,7 @@ impl Chain { /// Currently does not write these to disk and simply deserializes /// the provided data. /// TODO - Write this data to disk and validate the rebuilt kernel MMR. - pub fn kernel_data_write(&self, reader: &mut Read) -> Result<(), Error> { + pub fn kernel_data_write(&self, reader: &mut dyn Read) -> Result<(), Error> { let mut count = 0; let mut stream = StreamingReader::new(reader, ProtocolVersion::local()); while let Ok(_kernel) = TxKernelEntry::read(&mut stream) { @@ -1390,7 +1390,7 @@ fn setup_head( batch.save_header_head(&tip)?; if genesis.kernels().len() > 0 { - let (utxo_sum, kernel_sum) = (sums, genesis as &Committed).verify_kernel_sums( + let (utxo_sum, kernel_sum) = (sums, genesis as &dyn Committed).verify_kernel_sums( genesis.header.overage(), genesis.header.total_kernel_offset(), )?; diff --git a/core/src/core/block.rs b/core/src/core/block.rs index 2aea0c5ee..86614ef9d 100644 --- a/core/src/core/block.rs +++ b/core/src/core/block.rs @@ -123,7 +123,7 @@ pub struct HeaderEntry { } impl Readable for HeaderEntry { - fn read(reader: &mut Reader) -> Result { + fn read(reader: &mut dyn Reader) -> Result { let hash = Hash::read(reader)?; let timestamp = reader.read_u64()?; let total_difficulty = Difficulty::read(reader)?; diff --git a/core/src/core/pmmr/backend.rs b/core/src/core/pmmr/backend.rs index e5a43d557..547d862c0 100644 --- a/core/src/core/pmmr/backend.rs +++ b/core/src/core/pmmr/backend.rs @@ -53,7 +53,7 @@ pub trait Backend { fn get_data_from_file(&self, position: u64) -> Option; /// Iterator over current (unpruned, unremoved) leaf positions. - fn leaf_pos_iter(&self) -> Box + '_>; + fn leaf_pos_iter(&self) -> Box + '_>; /// Remove Hash by insertion position. An index is also provided so the /// underlying backend can implement some rollback of positions up to a diff --git a/core/src/core/pmmr/rewindable_pmmr.rs b/core/src/core/pmmr/rewindable_pmmr.rs index 3c5911f28..857d4bb83 100644 --- a/core/src/core/pmmr/rewindable_pmmr.rs +++ b/core/src/core/pmmr/rewindable_pmmr.rs @@ -50,7 +50,7 @@ where } /// Reference to the underlying storage backend. - pub fn backend(&'a self) -> &Backend { + pub fn backend(&'a self) -> &dyn Backend { self.backend } diff --git a/p2p/src/peer.rs b/p2p/src/peer.rs index 6927ce565..c14809b91 100644 --- a/p2p/src/peer.rs +++ b/p2p/src/peer.rs @@ -567,7 +567,7 @@ impl ChainAdapter for TrackingAdapter { self.adapter.kernel_data_read() } - fn kernel_data_write(&self, reader: &mut Read) -> Result { + fn kernel_data_write(&self, reader: &mut dyn Read) -> Result { self.adapter.kernel_data_write(reader) } diff --git a/p2p/src/peers.rs b/p2p/src/peers.rs index c4d6715b4..fa871c338 100644 --- a/p2p/src/peers.rs +++ b/p2p/src/peers.rs @@ -670,7 +670,7 @@ impl ChainAdapter for Peers { self.adapter.kernel_data_read() } - fn kernel_data_write(&self, reader: &mut Read) -> Result { + fn kernel_data_write(&self, reader: &mut dyn Read) -> Result { self.adapter.kernel_data_write(reader) } diff --git a/p2p/src/serv.rs b/p2p/src/serv.rs index a8a48ec07..28cc5fe93 100644 --- a/p2p/src/serv.rs +++ b/p2p/src/serv.rs @@ -303,7 +303,7 @@ impl ChainAdapter for DummyAdapter { fn kernel_data_read(&self) -> Result { unimplemented!() } - fn kernel_data_write(&self, _reader: &mut Read) -> Result { + fn kernel_data_write(&self, _reader: &mut dyn Read) -> Result { unimplemented!() } fn txhashset_read(&self, _h: Hash) -> Option { diff --git a/p2p/src/types.rs b/p2p/src/types.rs index bcd92a4d7..c8d9e76c4 100644 --- a/p2p/src/types.rs +++ b/p2p/src/types.rs @@ -561,7 +561,7 @@ pub trait ChainAdapter: Sync + Send { fn kernel_data_read(&self) -> Result; - fn kernel_data_write(&self, reader: &mut Read) -> Result; + fn kernel_data_write(&self, reader: &mut dyn Read) -> Result; /// Provides a reading view into the current txhashset state as well as /// the required indexes for a consumer to rewind to a consistant state diff --git a/servers/src/common/adapters.rs b/servers/src/common/adapters.rs index 698850d46..9d8a11850 100644 --- a/servers/src/common/adapters.rs +++ b/servers/src/common/adapters.rs @@ -347,7 +347,7 @@ impl p2p::ChainAdapter for NetToChainAdapter { self.chain().kernel_data_read() } - fn kernel_data_write(&self, reader: &mut Read) -> Result { + fn kernel_data_write(&self, reader: &mut dyn Read) -> Result { let res = self.chain().kernel_data_write(reader)?; error!("***** kernel_data_write: {:?}", res); Ok(true) diff --git a/servers/src/common/hooks.rs b/servers/src/common/hooks.rs index 140f31db5..8b21c050f 100644 --- a/servers/src/common/hooks.rs +++ b/servers/src/common/hooks.rs @@ -37,7 +37,7 @@ use tokio::runtime::Runtime; /// Returns the list of event hooks that will be initialized for network events pub fn init_net_hooks(config: &ServerConfig) -> Vec> { - let mut list: Vec> = Vec::new(); + let mut list: Vec> = Vec::new(); list.push(Box::new(EventLogger)); if config.webhook_config.block_received_url.is_some() || config.webhook_config.tx_received_url.is_some() @@ -50,7 +50,7 @@ pub fn init_net_hooks(config: &ServerConfig) -> Vec Vec> { - let mut list: Vec> = Vec::new(); + let mut list: Vec> = Vec::new(); list.push(Box::new(EventLogger)); if config.webhook_config.block_accepted_url.is_some() { list.push(Box::new(WebHook::from_config(&config.webhook_config))); diff --git a/servers/src/grin/dandelion_monitor.rs b/servers/src/grin/dandelion_monitor.rs index faed0cce1..72d1ce8ac 100644 --- a/servers/src/grin/dandelion_monitor.rs +++ b/servers/src/grin/dandelion_monitor.rs @@ -36,7 +36,7 @@ use crate::util::{RwLock, StopState}; pub fn monitor_transactions( dandelion_config: DandelionConfig, tx_pool: Arc>, - adapter: Arc, + adapter: Arc, verifier_cache: Arc>, stop_state: Arc, ) -> std::io::Result> { @@ -102,7 +102,7 @@ fn select_txs_cutoff(pool: &Pool, cutoff_secs: u16) -> Vec { fn process_fluff_phase( dandelion_config: &DandelionConfig, tx_pool: &Arc>, - adapter: &Arc, + adapter: &Arc, verifier_cache: &Arc>, ) -> Result<(), PoolError> { // Take a write lock on the txpool for the duration of this processing. diff --git a/store/src/pmmr.rs b/store/src/pmmr.rs index ceed2ef0d..9e324d924 100644 --- a/store/src/pmmr.rs +++ b/store/src/pmmr.rs @@ -132,7 +132,7 @@ impl Backend for PMMRBackend { /// Returns an iterator over all the leaf positions. /// for a prunable PMMR this is an iterator over the leaf_set bitmap. /// For a non-prunable PMMR this is *all* leaves (this is not yet implemented). - fn leaf_pos_iter(&self) -> Box + '_> { + fn leaf_pos_iter(&self) -> Box + '_> { if self.prunable { Box::new(self.leaf_set.iter()) } else { @@ -472,7 +472,7 @@ pub fn clean_files_by_prefix>( let number_of_files_deleted: u32 = fs::read_dir(&path)? .flat_map( - |possible_dir_entry| -> Result> { + |possible_dir_entry| -> Result> { // result implements iterator and so if we were to use map here // we would have a list of Result> // but because we use flat_map, the errors get "discarded" and we are