Extract the hard dependency on rocksdb from the light client (#8034)
* Extract the hard dependency on rocksdb from the light client * Remove TODO
This commit is contained in:
@@ -25,6 +25,7 @@ use tests::helpers::{TestNet, Peer as PeerLike, TestPacket};
|
||||
use ethcore::client::TestBlockChainClient;
|
||||
use ethcore::spec::Spec;
|
||||
use io::IoChannel;
|
||||
use kvdb_memorydb;
|
||||
use light::client::fetch::{self, Unavailable};
|
||||
use light::net::{LightProtocol, IoContext, Capabilities, Params as LightParams};
|
||||
use light::provider::LightProvider;
|
||||
@@ -218,13 +219,16 @@ impl TestNet<Peer> {
|
||||
// skip full verification because the blocks are bad.
|
||||
config.verify_full = false;
|
||||
let cache = Arc::new(Mutex::new(Cache::new(Default::default(), Duration::hours(6))));
|
||||
let client = LightClient::in_memory(
|
||||
let db = kvdb_memorydb::create(0);
|
||||
let client = LightClient::new(
|
||||
config,
|
||||
Arc::new(db),
|
||||
None,
|
||||
&Spec::new_test(),
|
||||
fetch::unavailable(), // TODO: allow fetch from full nodes.
|
||||
IoChannel::disconnected(),
|
||||
cache
|
||||
);
|
||||
).expect("New DB creation infallible; qed");
|
||||
|
||||
peers.push(Arc::new(Peer::new_light(Arc::new(client))))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user