fix clippy take 2

This commit is contained in:
Boog900 2024-08-01 21:29:51 +01:00
parent 524946f840
commit 4c310720b9
No known key found for this signature in database
GPG key ID: 42AB1287CB0041C2
3 changed files with 5 additions and 5 deletions

View file

@ -32,7 +32,7 @@ async fn context_invalidated_on_new_block() -> Result<(), tower::BoxError> {
const BLOCKCHAIN_HEIGHT: usize = 6000;
let mut runner = TestRunner::default();
let db = arb_dummy_database(BLOCKCHAIN_HEIGHT.try_into().unwrap())
let db = arb_dummy_database(BLOCKCHAIN_HEIGHT)
.new_tree(&mut runner)
.unwrap()
.current();
@ -74,7 +74,7 @@ async fn context_height_correct() -> Result<(), tower::BoxError> {
const BLOCKCHAIN_HEIGHT: usize = 6000;
let mut runner = TestRunner::default();
let db = arb_dummy_database(BLOCKCHAIN_HEIGHT.try_into().unwrap())
let db = arb_dummy_database(BLOCKCHAIN_HEIGHT)
.new_tree(&mut runner)
.unwrap()
.current();

View file

@ -101,7 +101,7 @@ prop_compose! {
let (timestamps, mut cumulative_difficulties): (Vec<_>, Vec<_>) = blocks.into_iter().unzip();
cumulative_difficulties.sort_unstable();
DifficultyCache {
last_accounted_height: timestamps.len().try_into().unwrap(),
last_accounted_height: timestamps.len(),
config: TEST_DIFFICULTY_CONFIG,
timestamps: timestamps.into(),
// we generate cumulative_difficulties in range 0..u64::MAX as if the generated values are close to u128::MAX
@ -162,7 +162,7 @@ proptest! {
let mut timestamps: VecDeque<u64> = timestamps.into();
let diff_cache = DifficultyCache {
last_accounted_height: (TEST_WINDOW -1).try_into().unwrap(),
last_accounted_height: TEST_WINDOW -1,
config: TEST_DIFFICULTY_CONFIG,
timestamps: timestamps.clone(),
// we dont need cumulative_difficulties

View file

@ -150,7 +150,7 @@ impl Service<BCReadRequest> for DummyDatabase {
async move {
Ok(match req {
BCReadRequest::BlockExtendedHeader(id) => {
let mut id = usize::try_from(id).unwrap();
let mut id = id;
if let Some(dummy_height) = dummy_height {
let block_len = blocks.read().unwrap().len();