Test harness for lightsync (#4109)

* make on_connect/disconnect public

* free flow params constructor

* Shared ownership of LES handlers

* light provider impl for test client

* skeleton for testing light sync

* have test_client use actual genesis

* fix underflow in provider

* test harnesses for lightsync

* fix tests

* fix test failure caused by test_client changes
This commit is contained in:
Robert Habermeier
2017-01-11 14:39:03 +01:00
committed by Arkadiy Paronyan
parent 7286d42b7d
commit 7123f19a75
12 changed files with 451 additions and 106 deletions

View File

@@ -179,7 +179,7 @@ impl EthSync {
};
let mut light_proto = LightProtocol::new(params.provider, light_params);
light_proto.add_handler(Box::new(TxRelay(params.chain.clone())));
light_proto.add_handler(Arc::new(TxRelay(params.chain.clone())));
Arc::new(light_proto)
})
@@ -612,7 +612,7 @@ impl LightSync {
let mut light_proto = LightProtocol::new(params.client.clone(), light_params);
let sync_handler = try!(SyncHandler::new(params.client.clone()));
light_proto.add_handler(Box::new(sync_handler));
light_proto.add_handler(Arc::new(sync_handler));
Arc::new(light_proto)
};