From 44fdf784ec3fa453385300b1f88847fe0fd6a303 Mon Sep 17 00:00:00 2001 From: Boog900 <54e72d8a-345f-4599-bd90-c6b9bc7d0ec5@aleeas.com> Date: Mon, 2 Dec 2024 21:05:56 +0000 Subject: [PATCH] Result -> DbResult --- storage/blockchain/src/service/read.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/storage/blockchain/src/service/read.rs b/storage/blockchain/src/service/read.rs index 4f47aa56..f3e0a65a 100644 --- a/storage/blockchain/src/service/read.rs +++ b/storage/blockchain/src/service/read.rs @@ -22,7 +22,9 @@ use rayon::{ }; use thread_local::ThreadLocal; -use cuprate_database::{ConcreteEnv, DatabaseIter, DbResult, DatabaseRo, Env, EnvInner, RuntimeError}; +use cuprate_database::{ + ConcreteEnv, DatabaseIter, DatabaseRo, DbResult, Env, EnvInner, RuntimeError, +}; use cuprate_database_service::{init_thread_pool, DatabaseReadService, ReaderThreads}; use cuprate_helper::map::combine_low_high_bits_to_u128; use cuprate_types::{ @@ -224,7 +226,7 @@ fn block_complete_entries(env: &ConcreteEnv, block_hashes: Vec) -> Re res => res.map(Either::Right), } }) - .collect::>()?; + .collect::>()?; let tx_ro = tx_ro.get_or_try(|| env_inner.tx_ro())?; let tables = get_tables!(env_inner, tx_ro, tables)?.as_ref(); @@ -375,7 +377,7 @@ fn block_extended_header_in_range( } }) }) - .collect::, _>>()? + .collect::>>()? } }; @@ -621,7 +623,7 @@ fn next_chain_entry( Ok((block_info.block_hash, block_info.weight)) }) - .collect::, Vec<_>), RuntimeError>>()?; + .collect::, Vec<_>)>>()?; let top_block_info = table_block_infos.get(&(chain_height - 1))?; @@ -688,7 +690,7 @@ fn txs_in_block(env: &ConcreteEnv, block_hash: [u8; 32], missing_txs: Vec) let txs = missing_txs .into_iter() .map(|index_offset| Ok(tables.tx_blobs().get(&(first_tx_index + index_offset))?.0)) - .collect::>()?; + .collect::>()?; Ok(BlockchainResponse::TxsInBlock(Some(TxsInBlock { block, @@ -733,7 +735,7 @@ fn alt_blocks_in_chain(env: &ConcreteEnv, chain_id: ChainId) -> ResponseResult { ) }) }) - .collect::>()?; + .collect::>()?; Ok(BlockchainResponse::AltBlocksInChain(blocks)) }