Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
bump smallvec to 0.6 in ethcore-light, ethstore and whisper (#9588)
Browse files Browse the repository at this point in the history
* bump smallvec to 0.6 in ethcore-light, ethstore and whisper

* bump transaction-pool

* Fix test.
  • Loading branch information
debris authored and 5chdn committed Sep 25, 2018
1 parent 692d5b4 commit 2609e2d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 30 deletions.
28 changes: 9 additions & 19 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 ethcore/light/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ vm = { path = "../vm" }
fastmap = { path = "../../util/fastmap" }
rlp = { version = "0.2.4", features = ["ethereum"] }
rlp_derive = { path = "../../util/rlp_derive" }
smallvec = "0.4"
smallvec = "0.6"
futures = "0.1"
rand = "0.4"
itertools = "0.5"
Expand Down
1 change: 0 additions & 1 deletion ethcore/sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ env_logger = "0.5"
rand = "0.4"
heapsize = "0.4"
semver = "0.9"
smallvec = { version = "0.4", features = ["heapsizeof"] }
parking_lot = "0.6"
trace-time = "0.1"
ipnetwork = "0.12.6"
Expand Down
7 changes: 2 additions & 5 deletions ethcore/sync/src/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

use std::collections::{HashSet, HashMap, hash_map};
use smallvec::SmallVec;
use hash::{keccak, KECCAK_NULL_RLP, KECCAK_EMPTY_LIST_RLP};
use heapsize::HeapSizeOf;
use ethereum_types::H256;
Expand All @@ -29,8 +28,6 @@ use transaction::UnverifiedTransaction;

known_heap_size!(0, HeaderId);

type SmallHashVec = SmallVec<[H256; 1]>;

#[derive(PartialEq, Debug, Clone)]
pub struct SyncHeader {
pub bytes: Bytes,
Expand Down Expand Up @@ -157,7 +154,7 @@ pub struct BlockCollection {
/// Used to map body to header.
header_ids: HashMap<HeaderId, H256>,
/// Used to map receipts root to headers.
receipt_ids: HashMap<H256, SmallHashVec>,
receipt_ids: HashMap<H256, Vec<H256>>,
/// First block in `blocks`.
head: Option<H256>,
/// Set of block header hashes being downloaded
Expand Down Expand Up @@ -522,7 +519,7 @@ impl BlockCollection {
let receipts_stream = RlpStream::new_list(0);
(Some(receipts_stream.out()), receipt_root)
} else {
self.receipt_ids.entry(receipt_root).or_insert_with(|| SmallHashVec::new()).push(hash);
self.receipt_ids.entry(receipt_root).or_insert_with(Vec::new).push(hash);
(None, receipt_root)
}
} else {
Expand Down
1 change: 0 additions & 1 deletion ethcore/sync/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ extern crate fastmap;
extern crate rand;
extern crate semver;
extern crate parking_lot;
extern crate smallvec;
extern crate rlp;
extern crate ipnetwork;
extern crate keccak_hash as hash;
Expand Down
2 changes: 1 addition & 1 deletion ethstore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ parking_lot = "0.6"
parity-crypto = "0.1"
ethereum-types = "0.4"
dir = { path = "../util/dir" }
smallvec = "0.4"
smallvec = "0.6"
parity-wordlist = "1.0"
tempdir = "0.3"

Expand Down
4 changes: 3 additions & 1 deletion miner/src/pool/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ fn should_return_correct_nonces_when_dropped_because_of_limit() {
// when
let tx1 = Tx::gas_price(2).signed();
let tx2 = Tx::gas_price(2).signed();
let sender = tx2.sender();
let tx3 = Tx::gas_price(1).signed();
let tx4 = Tx::gas_price(3).signed();
let res = txq.import(TestClient::new(), vec![tx1, tx2].retracted());
Expand All @@ -90,7 +91,8 @@ fn should_return_correct_nonces_when_dropped_because_of_limit() {
Ok(())
]);
assert_eq!(txq.status().status.transaction_count, 3);
// First inserted transacton got dropped because of limit
// tx2 transacton got dropped because of limit
// tx1 and tx1' are kept, because they have lower insertion_ids so they are preferred.
assert_eq!(txq.next_nonce(TestClient::new(), &sender), None);
}

Expand Down
2 changes: 1 addition & 1 deletion whisper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
slab = "0.3"
smallvec = "0.4"
smallvec = "0.6"
tiny-keccak = "1.4"

jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
Expand Down

0 comments on commit 2609e2d

Please sign in to comment.