Skip to content

Commit

Permalink
use upstream multi_index_map
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukang committed Aug 7, 2023
1 parent 90b57b3 commit 0755241
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
41 changes: 25 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tx-pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sentry = { version = "0.26.0", optional = true }
serde_json = "1.0"
rand = "0.8.4"
hyper = { version = "0.14", features = ["http1", "client", "tcp"] }
ckb_multi_index_map = "0.0.2" # ckb team fork crate
multi_index_map = "0.6.0"
slab = "0.4"
rustc-hash = "1.1"
tokio-util = "0.7.8"
Expand Down
2 changes: 1 addition & 1 deletion tx-pool/src/component/commit_txs_scanner.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
extern crate slab;
use crate::component::pool_map::PoolMap;
use crate::component::{entry::TxEntry, sort_key::AncestorsScoreSortKey};
use ckb_multi_index_map::MultiIndexMap;
use ckb_types::{core::Cycle, packed::ProposalShortId};
use ckb_util::LinkedHashMap;
use multi_index_map::MultiIndexMap;
use std::collections::HashSet;

// A template data struct used to store modified entries when package txs
Expand Down
9 changes: 3 additions & 6 deletions tx-pool/src/component/pool_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use crate::component::links::{Relation, TxLinksMap};
use crate::component::sort_key::{AncestorsScoreSortKey, EvictKey};
use crate::error::Reject;
use crate::TxEntry;
use ckb_logger::{debug, trace};
use ckb_multi_index_map::MultiIndexMap;

use ckb_logger::trace;
use ckb_types::core::error::OutPointError;
use ckb_types::packed::OutPoint;
use ckb_types::prelude::*;
Expand All @@ -16,6 +16,7 @@ use ckb_types::{
core::TransactionView,
packed::{Byte32, CellOutput, ProposalShortId},
};
use multi_index_map::MultiIndexMap;
use std::collections::HashSet;

use super::links::TxLinks;
Expand Down Expand Up @@ -114,10 +115,6 @@ impl PoolMap {
self.get_by_id(id).expect("unconsistent pool")
}

fn get_by_id_checked(&self, id: &ProposalShortId) -> &PoolEntry {
self.get_by_id(id).expect("unconsistent pool")
}

pub(crate) fn get_by_status(&self, status: Status) -> Vec<&PoolEntry> {
self.entries.get_by_status(&status)
}
Expand Down

0 comments on commit 0755241

Please sign in to comment.