fix compile warnings (#10993)

* fix warnings

* fix: failing build, use `spec` as dev-dependency
This commit is contained in:
Niklas Adolfsson
2019-08-27 17:29:33 +02:00
committed by Andronik Ordian
parent 505e284932
commit dab2a6bd4b
69 changed files with 203 additions and 199 deletions

View File

@@ -743,7 +743,7 @@ impl SyncHandler {
Ok(())
}
fn on_private_state_data(sync: &mut ChainSync, io: &mut SyncIo, peer_id: PeerId, r: &Rlp) -> Result<(), DownloaderImportError> {
fn on_private_state_data(sync: &mut ChainSync, io: &mut dyn SyncIo, peer_id: PeerId, r: &Rlp) -> Result<(), DownloaderImportError> {
if !sync.peers.get(&peer_id).map_or(false, |p| p.can_sync()) {
trace!(target: "sync", "{} Ignoring packet from unconfirmed/unknown peer", peer_id);
return Ok(());

View File

@@ -1382,7 +1382,7 @@ impl ChainSync {
}
/// Request private state from peers
pub fn request_private_state(&mut self, io: &mut SyncIo, hash: &H256) {
pub fn request_private_state(&mut self, io: &mut dyn SyncIo, hash: &H256) {
let private_state_peers = self.get_private_state_peers();
if private_state_peers.is_empty() {
error!(target: "privatetx", "Cannot request private state, no peers with private tx enabled available");

View File

@@ -100,7 +100,7 @@ impl SyncRequester {
SyncRequester::send_request(sync, io, peer_id, PeerAsking::SnapshotManifest, GetSnapshotManifestPacket, rlp.out());
}
pub fn request_private_state(sync: &mut ChainSync, io: &mut SyncIo, peer_id: PeerId, hash: &H256) {
pub fn request_private_state(sync: &mut ChainSync, io: &mut dyn SyncIo, peer_id: PeerId, hash: &H256) {
trace!(target: "privatetx", "{} <- GetPrivateStatePacket", peer_id);
let mut rlp = RlpStream::new_list(1);
rlp.append(hash);

View File

@@ -356,7 +356,7 @@ impl SyncSupplier {
}
/// Respond to GetPrivateStatePacket
fn return_private_state(io: &SyncIo, r: &Rlp, peer_id: PeerId) -> RlpResponseResult {
fn return_private_state(io: &dyn SyncIo, r: &Rlp, peer_id: PeerId) -> RlpResponseResult {
let hash: H256 = r.val_at(0)?;
trace!(target: "privatetx", "{} -> GetPrivateStatePacket {:?}", peer_id, hash);
io.private_state().map_or(Ok(None), |db| {