diff --git a/tx-pool/src/process.rs b/tx-pool/src/process.rs index ef195964894..815ca3a76b8 100644 --- a/tx-pool/src/process.rs +++ b/tx-pool/src/process.rs @@ -11,7 +11,7 @@ use crate::util::{ non_contextual_verify, time_relative_verify, verify_rtx, }; use ckb_chain_spec::consensus::MAX_BLOCK_PROPOSALS_LIMIT; -use ckb_error::{AnyError, Error, InternalErrorKind}; +use ckb_error::{AnyError, InternalErrorKind}; use ckb_jsonrpc_types::BlockTemplate; use ckb_logger::Level::Trace; use ckb_logger::{debug, error, info, log_enabled_target, trace_target}; @@ -20,7 +20,6 @@ use ckb_snapshot::Snapshot; use ckb_store::data_loader_wrapper::AsDataLoader; use ckb_store::ChainStore; use ckb_types::core::error::OutPointError; -use ckb_types::core::tx_pool::EntryCompleted; use ckb_types::{ core::{cell::ResolvedTransaction, BlockView, Capacity, Cycle, HeaderView, TransactionView}, packed::{Byte32, ProposalShortId}, diff --git a/tx-pool/src/service.rs b/tx-pool/src/service.rs index b7ee191fbe8..64f17f4aa99 100644 --- a/tx-pool/src/service.rs +++ b/tx-pool/src/service.rs @@ -27,7 +27,7 @@ use ckb_types::{ packed::{Byte32, ProposalShortId}, }; use ckb_util::{LinkedHashMap, LinkedHashSet}; -use ckb_verification::cache::{Completed, TxVerificationCache}; +use ckb_verification::cache::TxVerificationCache; use std::collections::{HashMap, HashSet, VecDeque}; use std::sync::{ atomic::{AtomicBool, Ordering}, diff --git a/verification/src/cache.rs b/verification/src/cache.rs index 0e84ebe807a..4165f4d1db1 100644 --- a/verification/src/cache.rs +++ b/verification/src/cache.rs @@ -5,7 +5,6 @@ use ckb_types::{ core::{Capacity, Cycle, EntryCompleted}, packed::Byte32, }; -use std::collections::hash_map::Entry; use std::sync::Arc; /// TX verification lru cache @@ -45,11 +44,11 @@ pub struct Completed { pub fee: Capacity, } -impl Into for Completed { - fn into(self) -> EntryCompleted { +impl From for EntryCompleted { + fn from(value: Completed) -> Self { EntryCompleted { - cycles: self.cycles, - fee: self.fee, + cycles: value.cycles, + fee: value.fee, } } }