diff --git a/components/addressmanager/src/stores/address_store.rs b/components/addressmanager/src/stores/address_store.rs index accfcfda4..fe4ddb244 100644 --- a/components/addressmanager/src/stores/address_store.rs +++ b/components/addressmanager/src/stores/address_store.rs @@ -21,6 +21,7 @@ pub struct Entry { impl MemSizeEstimator for Entry {} pub trait AddressesStoreReader { + #[allow(dead_code)] fn get(&self, key: AddressKey) -> Result; } diff --git a/crypto/hashes/src/hashers.rs b/crypto/hashes/src/hashers.rs index 7f6775aaa..b45026bd2 100644 --- a/crypto/hashes/src/hashers.rs +++ b/crypto/hashes/src/hashers.rs @@ -51,7 +51,7 @@ macro_rules! sha256_hasher { // SHA256 doesn't natively support domain separation, so we hash it to make it constant size. let mut tmp_state = Sha256::new(); tmp_state.update($domain_sep); - let mut out = Self(Sha256::new()); + let mut out = $name(Sha256::new()); out.write(tmp_state.finalize()); out diff --git a/crypto/muhash/Cargo.toml b/crypto/muhash/Cargo.toml index b5badb664..cef8ec5bf 100644 --- a/crypto/muhash/Cargo.toml +++ b/crypto/muhash/Cargo.toml @@ -26,3 +26,5 @@ rand.workspace = true name = "bench" harness = false +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] } diff --git a/mining/src/block_template/model/tx.rs b/mining/src/block_template/model/tx.rs index b0c7e3f56..65493e63b 100644 --- a/mining/src/block_template/model/tx.rs +++ b/mining/src/block_template/model/tx.rs @@ -73,7 +73,8 @@ impl CandidateList { /// * tx1: start 0, end 100 /// * tx2: start 100, end 105 /// * tx3: start 105, end 2000 - /// And r=102, then find will return tx2. + /// + /// And r=102, then [`CandidateList::find`] will return tx2. pub(crate) fn find(&self, r: f64) -> usize { let mut min = 0; let mut max = self.candidates.len() - 1; diff --git a/wallet/core/src/storage/local/transaction/fsio.rs b/wallet/core/src/storage/local/transaction/fsio.rs index ac44a136d..b4a74334c 100644 --- a/wallet/core/src/storage/local/transaction/fsio.rs +++ b/wallet/core/src/storage/local/transaction/fsio.rs @@ -115,7 +115,7 @@ impl TransactionRecordStore for TransactionStore { let mut transactions = vec![]; for id in ids { - let path = folder.join(&id.to_hex()); + let path = folder.join(id.to_hex()); match read(&path, None).await { Ok(tx) => { transactions.push(Arc::new(tx)); @@ -144,7 +144,7 @@ impl TransactionRecordStore for TransactionStore { let mut located = 0; for id in ids { - let path = folder.join(&id.to_hex()); + let path = folder.join(id.to_hex()); match read(&path, None).await { Ok(tx) => { @@ -167,7 +167,7 @@ impl TransactionRecordStore for TransactionStore { let iter = ids.iter().skip(range.start).take(range.len()); for id in iter { - let path = folder.join(&id.to_hex()); + let path = folder.join(id.to_hex()); match read(&path, None).await { Ok(tx) => { transactions.push(Arc::new(tx)); diff --git a/wallet/core/src/tx/generator/generator.rs b/wallet/core/src/tx/generator/generator.rs index 533f2e046..7040276b1 100644 --- a/wallet/core/src/tx/generator/generator.rs +++ b/wallet/core/src/tx/generator/generator.rs @@ -39,21 +39,22 @@ //! interface or via an async Stream interface. //! //! Q: Why is this not implemented as a single loop? +//! //! A: There are a number of requirements that need to be handled: //! -//! 1. UTXO entry consumption while creating inputs may results in -//! additional fees, requiring additional UTXO entries to cover -//! the fees. Goto 1. (this is a classic issue, can be solved using padding) +//! 1. UTXO entry consumption while creating inputs may result in +//! additional fees, requiring additional UTXO entries to cover +//! the fees. Goto 1. (this is a classic issue, can be solved using padding) //! -//! 2. The overall design strategy for this processor is to allow -//! concurrent processing of a large number of transactions and UTXOs. -//! This implementation avoids in-memory aggregation of all -//! transactions that may result in OOM conditions. +//! 2. The overall design strategy for this processor is to allow +//! concurrent processing of a large number of transactions and UTXOs. +//! This implementation avoids in-memory aggregation of all +//! transactions that may result in OOM conditions. //! -//! 3. If used with a large UTXO set, the transaction generation process -//! needs to be asynchronous to avoid blocking the main thread. In the -//! context of WASM32 SDK, not doing that while working with large -//! UTXO sets will result in a browser UI freezing. +//! 3. If used with a large UTXO set, the transaction generation process +//! needs to be asynchronous to avoid blocking the main thread. In the +//! context of WASM32 SDK, not doing that while working with large +//! UTXO sets will result in a browser UI freezing. //! use crate::imports::*; @@ -553,16 +554,18 @@ impl Generator { /// /// The general processing pattern can be described as follows: /// - /// loop { - /// 1. Obtain UTXO entry from [`Generator::get_utxo_entry()`] - /// 2. Check if UTXO entries have been depleted, if so, handle sweep processing. - /// 3. Create a new Input for the transaction from the UTXO entry. - /// 4. Check if the transaction mass threshold has been reached, if so, yield the transaction. - /// 5. Register input with the [`Data`] structures. - /// 6. Check if the final transaction amount has been reached, if so, yield the transaction. - /// } - /// - /// + /** + loop { + 1. Obtain UTXO entry from [`Generator::get_utxo_entry()`] + 2. Check if UTXO entries have been depleted, if so, handle sweep processing. + 3. Create a new Input for the transaction from the UTXO entry. + 4. Check if the transaction mass threshold has been reached, if so, yield the transaction. + 5. Register input with the [`Data`] structures. + 6. Check if the final transaction amount has been reached, if so, yield the transaction. + + } + */ + fn generate_transaction_data(&self, context: &mut Context, stage: &mut Stage) -> Result<(DataKind, Data)> { let calc = &self.inner.mass_calculator; let mut data = Data::new(calc); diff --git a/wallet/core/src/utxo/context.rs b/wallet/core/src/utxo/context.rs index 51ef0e5ea..26e19bc55 100644 --- a/wallet/core/src/utxo/context.rs +++ b/wallet/core/src/utxo/context.rs @@ -568,6 +568,7 @@ impl UtxoContext { // remove UTXOs from account set let outgoing_transactions = self.processor().outgoing(); + #[allow(clippy::mutable_key_type)] let mut accepted_outgoing_transactions = HashSet::::new(); utxos.retain(|utxo| { diff --git a/wallet/core/src/utxo/processor.rs b/wallet/core/src/utxo/processor.rs index e788272f2..49bebbd7a 100644 --- a/wallet/core/src/utxo/processor.rs +++ b/wallet/core/src/utxo/processor.rs @@ -264,6 +264,7 @@ impl UtxoProcessor { Ok(()) } + #[allow(clippy::mutable_key_type)] pub async fn handle_pending(&self, current_daa_score: u64) -> Result<()> { let params = self.network_params()?; @@ -388,6 +389,7 @@ impl UtxoProcessor { pub async fn handle_utxo_changed(&self, utxos: UtxosChangedNotification) -> Result<()> { let current_daa_score = self.current_daa_score().expect("DAA score expected when handling UTXO Changed notifications"); + #[allow(clippy::mutable_key_type)] let mut updated_contexts: HashSet = HashSet::default(); let removed = (*utxos.removed).clone().into_iter().filter_map(|entry| entry.address.clone().map(|address| (address, entry))); diff --git a/wasm/build/docs/typedoc.json b/wasm/build/docs/typedoc.json index 1092872b6..db308c812 100644 --- a/wasm/build/docs/typedoc.json +++ b/wasm/build/docs/typedoc.json @@ -3,5 +3,5 @@ "treatWarningsAsErrors": false, "cleanOutputDir": true, "disableSources": true, - "categoryOrder": ["*", "Other"], + "categoryOrder": ["*", "Other"] }