mirror of
https://github.com/MAGICGrants/cuprate-for-explorer.git
synced 2026-01-09 19:47:59 -05:00
workspace: add/fix 1.83 lints (#353)
* 1.83 `cargo clippy --fix` * fix type complexity, add `DbResult` * clippy fix * redb fix * Update consensus/context/src/difficulty.rs Co-authored-by: hinto-janai <hinto.janai@protonmail.com> --------- Co-authored-by: Boog900 <boog900@tutanota.com>
This commit is contained in:
@@ -328,8 +328,8 @@ fn next_difficulty(
|
||||
time_span = 1;
|
||||
}
|
||||
|
||||
// TODO: do checked operations here and unwrap so we don't silently overflow?
|
||||
(windowed_work * u128::from(hf.block_time().as_secs()) + time_span - 1) / time_span
|
||||
// TODO: do `checked_mul` here and unwrap so we don't silently overflow?
|
||||
(windowed_work * u128::from(hf.block_time().as_secs())).div_ceil(time_span)
|
||||
}
|
||||
|
||||
/// Get the start and end of the window to calculate difficulty.
|
||||
|
||||
@@ -9,7 +9,7 @@ use clap::Parser;
|
||||
use tower::{Service, ServiceExt};
|
||||
|
||||
use cuprate_blockchain::{
|
||||
config::ConfigBuilder, cuprate_database::RuntimeError, service::BlockchainReadHandle,
|
||||
config::ConfigBuilder, cuprate_database::DbResult, service::BlockchainReadHandle,
|
||||
};
|
||||
use cuprate_types::{
|
||||
blockchain::{BlockchainReadRequest, BlockchainResponse},
|
||||
@@ -23,7 +23,7 @@ const BATCH_SIZE: usize = 512;
|
||||
async fn read_batch(
|
||||
handle: &mut BlockchainReadHandle,
|
||||
height_from: usize,
|
||||
) -> Result<Vec<BlockId>, RuntimeError> {
|
||||
) -> DbResult<Vec<BlockId>> {
|
||||
let mut block_ids = Vec::<BlockId>::with_capacity(BATCH_SIZE);
|
||||
|
||||
for height in height_from..(height_from + BATCH_SIZE) {
|
||||
|
||||
Reference in New Issue
Block a user