Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
refactor(store): change store map to iter (#293)
Browse files Browse the repository at this point in the history
* refactor: use buckets instead of vector to iterate

* tmp

* feat iter

* refactor bench

* change get map key

* cargo clippy

* delete old code

* cargo clippy

Co-authored-by: Eason <[email protected]>
  • Loading branch information
Eason Gao and Eason authored May 28, 2020
1 parent fa4780d commit 53f4b00
Show file tree
Hide file tree
Showing 8 changed files with 524 additions and 102 deletions.
5 changes: 4 additions & 1 deletion framework/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ util = { path = "../built-in-services/util"}
hasher = { version = "0.1", features = ['hash-keccak'] }
cita_trie = "2.0"
bytes = "0.5"
derive_more = "0.15"
derive_more = "0.99"
rocksdb = "0.12"
lazy_static = "1.4"
byteorder = "1.3"
Expand All @@ -27,9 +27,12 @@ json = "0.12"
hex = "0.4"
serde_json = "1.0"
log = "0.4"
rayon = "1.3"

[dev-dependencies]
async-trait = "0.1"
toml = "0.5"
binding-macro = { path = "../binding-macro" }
rand = "0.7"
serde = { version = "1.0", features = ["derive"] }
muta-codec-derive = "0.2"
5 changes: 4 additions & 1 deletion framework/src/binding/sdk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ impl<S: 'static + ServiceState, C: ChainQuerier, D: Dispatcher> ServiceSDK
for DefalutServiceSDK<S, C, D>
{
// Alloc or recover a `Map` by` var_name`
fn alloc_or_recover_map<K: 'static + FixedCodec + PartialEq, V: 'static + FixedCodec>(
fn alloc_or_recover_map<
K: 'static + Send + FixedCodec + Clone + PartialEq,
V: 'static + FixedCodec,
>(
&mut self,
var_name: &str,
) -> Box<dyn StoreMap<K, V>> {
Expand Down
Loading

0 comments on commit 53f4b00

Please sign in to comment.