mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-01-25 03:55:52 +00:00
fix clippy take 2
This commit is contained in:
parent
524946f840
commit
4c310720b9
3 changed files with 5 additions and 5 deletions
|
@ -32,7 +32,7 @@ async fn context_invalidated_on_new_block() -> Result<(), tower::BoxError> {
|
||||||
const BLOCKCHAIN_HEIGHT: usize = 6000;
|
const BLOCKCHAIN_HEIGHT: usize = 6000;
|
||||||
|
|
||||||
let mut runner = TestRunner::default();
|
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)
|
.new_tree(&mut runner)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.current();
|
.current();
|
||||||
|
@ -74,7 +74,7 @@ async fn context_height_correct() -> Result<(), tower::BoxError> {
|
||||||
const BLOCKCHAIN_HEIGHT: usize = 6000;
|
const BLOCKCHAIN_HEIGHT: usize = 6000;
|
||||||
|
|
||||||
let mut runner = TestRunner::default();
|
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)
|
.new_tree(&mut runner)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.current();
|
.current();
|
||||||
|
|
|
@ -101,7 +101,7 @@ prop_compose! {
|
||||||
let (timestamps, mut cumulative_difficulties): (Vec<_>, Vec<_>) = blocks.into_iter().unzip();
|
let (timestamps, mut cumulative_difficulties): (Vec<_>, Vec<_>) = blocks.into_iter().unzip();
|
||||||
cumulative_difficulties.sort_unstable();
|
cumulative_difficulties.sort_unstable();
|
||||||
DifficultyCache {
|
DifficultyCache {
|
||||||
last_accounted_height: timestamps.len().try_into().unwrap(),
|
last_accounted_height: timestamps.len(),
|
||||||
config: TEST_DIFFICULTY_CONFIG,
|
config: TEST_DIFFICULTY_CONFIG,
|
||||||
timestamps: timestamps.into(),
|
timestamps: timestamps.into(),
|
||||||
// we generate cumulative_difficulties in range 0..u64::MAX as if the generated values are close to u128::MAX
|
// 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 mut timestamps: VecDeque<u64> = timestamps.into();
|
||||||
|
|
||||||
let diff_cache = DifficultyCache {
|
let diff_cache = DifficultyCache {
|
||||||
last_accounted_height: (TEST_WINDOW -1).try_into().unwrap(),
|
last_accounted_height: TEST_WINDOW -1,
|
||||||
config: TEST_DIFFICULTY_CONFIG,
|
config: TEST_DIFFICULTY_CONFIG,
|
||||||
timestamps: timestamps.clone(),
|
timestamps: timestamps.clone(),
|
||||||
// we dont need cumulative_difficulties
|
// we dont need cumulative_difficulties
|
||||||
|
|
|
@ -150,7 +150,7 @@ impl Service<BCReadRequest> for DummyDatabase {
|
||||||
async move {
|
async move {
|
||||||
Ok(match req {
|
Ok(match req {
|
||||||
BCReadRequest::BlockExtendedHeader(id) => {
|
BCReadRequest::BlockExtendedHeader(id) => {
|
||||||
let mut id = usize::try_from(id).unwrap();
|
let mut id = id;
|
||||||
if let Some(dummy_height) = dummy_height {
|
if let Some(dummy_height) = dummy_height {
|
||||||
let block_len = blocks.read().unwrap().len();
|
let block_len = blocks.read().unwrap().len();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue