Use rustc-hex instead of rustc-serialize in bloomchain tests (#7616)
This commit is contained in:
parent
5990c64e31
commit
f7012af92e
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -155,7 +155,7 @@ version = "0.2.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"ethbloom 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ethbloom 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -11,5 +11,5 @@ keywords = ["ethereum", "ethcore", "bloom", "chain", "filter"]
|
|||||||
ethbloom = "0.3"
|
ethbloom = "0.3"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
rustc-serialize = "0.3"
|
rustc-hex = "1.0"
|
||||||
rand = "0.4"
|
rand = "0.4"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
extern crate bloomchain;
|
extern crate bloomchain;
|
||||||
extern crate rustc_serialize;
|
extern crate rustc_hex;
|
||||||
|
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ fn partly_matching_bloom_searach() {
|
|||||||
|
|
||||||
db.insert_blooms(modified_blooms_1);
|
db.insert_blooms(modified_blooms_1);
|
||||||
|
|
||||||
|
|
||||||
let chain = BloomChain::new(config, &db);
|
let chain = BloomChain::new(config, &db);
|
||||||
assert_eq!(chain.with_bloom(&(0..100), &bloom2), vec![14, 15]);
|
assert_eq!(chain.with_bloom(&(0..100), &bloom2), vec![14, 15]);
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ fn bloom_replace() {
|
|||||||
let bloom3 = Bloom::from_hex("00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
|
let bloom3 = Bloom::from_hex("00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
|
||||||
let bloom4 = Bloom::from_hex("00001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
|
let bloom4 = Bloom::from_hex("00001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
|
||||||
let bloom5 = Bloom::from_hex("00000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
|
let bloom5 = Bloom::from_hex("00000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
|
||||||
|
|
||||||
let modified_blooms_0 = {
|
let modified_blooms_0 = {
|
||||||
let chain = BloomChain::new(config, &db);
|
let chain = BloomChain::new(config, &db);
|
||||||
let block_number = 14;
|
let block_number = 14;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
extern crate bloomchain;
|
extern crate bloomchain;
|
||||||
extern crate rustc_serialize;
|
extern crate rustc_hex;
|
||||||
|
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ fn partly_matching_bloom_group_searach() {
|
|||||||
|
|
||||||
db.insert_blooms(modified_blooms_1);
|
db.insert_blooms(modified_blooms_1);
|
||||||
|
|
||||||
|
|
||||||
let chain = BloomGroupChain::new(config, &db);
|
let chain = BloomGroupChain::new(config, &db);
|
||||||
assert_eq!(chain.with_bloom(&(0..100), &bloom2), vec![14, 15]);
|
assert_eq!(chain.with_bloom(&(0..100), &bloom2), vec![14, 15]);
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ fn bloom_group_replace() {
|
|||||||
let bloom3 = Bloom::from_hex("00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
|
let bloom3 = Bloom::from_hex("00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
|
||||||
let bloom4 = Bloom::from_hex("00001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
|
let bloom4 = Bloom::from_hex("00001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
|
||||||
let bloom5 = Bloom::from_hex("00000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
|
let bloom5 = Bloom::from_hex("00000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
|
||||||
|
|
||||||
let modified_blooms_0 = {
|
let modified_blooms_0 = {
|
||||||
let chain = BloomGroupChain::new(config, &db);
|
let chain = BloomGroupChain::new(config, &db);
|
||||||
let block_number = 14;
|
let block_number = 14;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use rustc_serialize::hex::FromHex as RustcFromHex;
|
use rustc_hex::FromHex as RustcFromHex;
|
||||||
use bloomchain::Bloom;
|
use bloomchain::Bloom;
|
||||||
|
|
||||||
pub trait FromHex {
|
pub trait FromHex {
|
||||||
|
Loading…
Reference in New Issue
Block a user