mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 17:57:56 +00:00
depend-o-pocalipse (#9450)
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See https://github.com/tokio-rs/tracing/issues/1429 )
This commit is contained in:
@@ -213,14 +213,15 @@ where
|
||||
) -> Result<Reply<B>, Error> {
|
||||
use schema::v1::light::response::Response;
|
||||
match response.response {
|
||||
Some(Response::RemoteCallResponse(response)) =>
|
||||
Some(Response::RemoteCallResponse(response)) => {
|
||||
if let Request::Call { request, .. } = request {
|
||||
let proof = Decode::decode(&mut response.proof.as_ref())?;
|
||||
let reply = self.checker.check_execution_proof(request, proof)?;
|
||||
Ok(Reply::VecU8(reply))
|
||||
} else {
|
||||
Err(Error::UnexpectedResponse)
|
||||
},
|
||||
}
|
||||
},
|
||||
Some(Response::RemoteReadResponse(response)) => match request {
|
||||
Request::Read { request, .. } => {
|
||||
let proof = Decode::decode(&mut response.proof.as_ref())?;
|
||||
@@ -234,7 +235,7 @@ where
|
||||
},
|
||||
_ => Err(Error::UnexpectedResponse),
|
||||
},
|
||||
Some(Response::RemoteChangesResponse(response)) =>
|
||||
Some(Response::RemoteChangesResponse(response)) => {
|
||||
if let Request::Changes { request, .. } = request {
|
||||
let max_block = Decode::decode(&mut response.max.as_ref())?;
|
||||
let roots_proof = Decode::decode(&mut response.roots_proof.as_ref())?;
|
||||
@@ -259,8 +260,9 @@ where
|
||||
Ok(Reply::VecNumberU32(reply))
|
||||
} else {
|
||||
Err(Error::UnexpectedResponse)
|
||||
},
|
||||
Some(Response::RemoteHeaderResponse(response)) =>
|
||||
}
|
||||
},
|
||||
Some(Response::RemoteHeaderResponse(response)) => {
|
||||
if let Request::Header { request, .. } = request {
|
||||
let header = if response.header.is_empty() {
|
||||
None
|
||||
@@ -272,7 +274,8 @@ where
|
||||
Ok(Reply::Header(reply))
|
||||
} else {
|
||||
Err(Error::UnexpectedResponse)
|
||||
},
|
||||
}
|
||||
},
|
||||
None => Err(Error::UnexpectedResponse),
|
||||
}
|
||||
}
|
||||
@@ -779,8 +782,9 @@ impl<B: Block> Request<B> {
|
||||
Request::Header { request, sender } => match result {
|
||||
Err(e) => send(Err(e), sender),
|
||||
Ok(Reply::Header(x)) => send(Ok(x), sender),
|
||||
reply =>
|
||||
log::error!("invalid reply for header request: {:?}, {:?}", reply, request),
|
||||
reply => {
|
||||
log::error!("invalid reply for header request: {:?}, {:?}", reply, request)
|
||||
},
|
||||
},
|
||||
Request::Read { request, sender } => match result {
|
||||
Err(e) => send(Err(e), sender),
|
||||
@@ -790,8 +794,9 @@ impl<B: Block> Request<B> {
|
||||
Request::ReadChild { request, sender } => match result {
|
||||
Err(e) => send(Err(e), sender),
|
||||
Ok(Reply::MapVecU8OptVecU8(x)) => send(Ok(x), sender),
|
||||
reply =>
|
||||
log::error!("invalid reply for read child request: {:?}, {:?}", reply, request),
|
||||
reply => {
|
||||
log::error!("invalid reply for read child request: {:?}, {:?}", reply, request)
|
||||
},
|
||||
},
|
||||
Request::Call { request, sender } => match result {
|
||||
Err(e) => send(Err(e), sender),
|
||||
@@ -801,8 +806,9 @@ impl<B: Block> Request<B> {
|
||||
Request::Changes { request, sender } => match result {
|
||||
Err(e) => send(Err(e), sender),
|
||||
Ok(Reply::VecNumberU32(x)) => send(Ok(x), sender),
|
||||
reply =>
|
||||
log::error!("invalid reply for changes request: {:?}, {:?}", reply, request),
|
||||
reply => {
|
||||
log::error!("invalid reply for changes request: {:?}, {:?}", reply, request)
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,8 +352,9 @@ impl NetworkBehaviour for PeerInfoBehaviour {
|
||||
let event = PeerInfoEvent::Identified { peer_id, info };
|
||||
return Poll::Ready(NetworkBehaviourAction::GenerateEvent(event))
|
||||
},
|
||||
IdentifyEvent::Error { peer_id, error } =>
|
||||
debug!(target: "sub-libp2p", "Identification with peer {:?} failed => {}", peer_id, error),
|
||||
IdentifyEvent::Error { peer_id, error } => {
|
||||
debug!(target: "sub-libp2p", "Identification with peer {:?} failed => {}", peer_id, error)
|
||||
},
|
||||
IdentifyEvent::Pushed { .. } => {},
|
||||
IdentifyEvent::Sent { .. } => {},
|
||||
},
|
||||
|
||||
@@ -565,8 +565,9 @@ impl Notifications {
|
||||
*entry.into_mut() = PeerState::Disabled { connections, backoff_until }
|
||||
},
|
||||
|
||||
PeerState::Poisoned =>
|
||||
error!(target: "sub-libp2p", "State of {:?} is poisoned", peer_id),
|
||||
PeerState::Poisoned => {
|
||||
error!(target: "sub-libp2p", "State of {:?} is poisoned", peer_id)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ where
|
||||
|
||||
loop {
|
||||
match mem::replace(this.handshake, NotificationsInSubstreamHandshake::Sent) {
|
||||
NotificationsInSubstreamHandshake::PendingSend(msg) =>
|
||||
NotificationsInSubstreamHandshake::PendingSend(msg) => {
|
||||
match Sink::poll_ready(this.socket.as_mut(), cx) {
|
||||
Poll::Ready(_) => {
|
||||
*this.handshake = NotificationsInSubstreamHandshake::Flush;
|
||||
@@ -231,8 +231,9 @@ where
|
||||
*this.handshake = NotificationsInSubstreamHandshake::PendingSend(msg);
|
||||
return Poll::Pending
|
||||
},
|
||||
},
|
||||
NotificationsInSubstreamHandshake::Flush =>
|
||||
}
|
||||
},
|
||||
NotificationsInSubstreamHandshake::Flush => {
|
||||
match Sink::poll_flush(this.socket.as_mut(), cx)? {
|
||||
Poll::Ready(()) =>
|
||||
*this.handshake = NotificationsInSubstreamHandshake::Sent,
|
||||
@@ -240,7 +241,8 @@ where
|
||||
*this.handshake = NotificationsInSubstreamHandshake::Flush;
|
||||
return Poll::Pending
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
st @ NotificationsInSubstreamHandshake::NotSent |
|
||||
st @ NotificationsInSubstreamHandshake::Sent |
|
||||
@@ -270,7 +272,7 @@ where
|
||||
*this.handshake = NotificationsInSubstreamHandshake::NotSent;
|
||||
return Poll::Pending
|
||||
},
|
||||
NotificationsInSubstreamHandshake::PendingSend(msg) =>
|
||||
NotificationsInSubstreamHandshake::PendingSend(msg) => {
|
||||
match Sink::poll_ready(this.socket.as_mut(), cx) {
|
||||
Poll::Ready(_) => {
|
||||
*this.handshake = NotificationsInSubstreamHandshake::Flush;
|
||||
@@ -283,8 +285,9 @@ where
|
||||
*this.handshake = NotificationsInSubstreamHandshake::PendingSend(msg);
|
||||
return Poll::Pending
|
||||
},
|
||||
},
|
||||
NotificationsInSubstreamHandshake::Flush =>
|
||||
}
|
||||
},
|
||||
NotificationsInSubstreamHandshake::Flush => {
|
||||
match Sink::poll_flush(this.socket.as_mut(), cx)? {
|
||||
Poll::Ready(()) =>
|
||||
*this.handshake = NotificationsInSubstreamHandshake::Sent,
|
||||
@@ -292,7 +295,8 @@ where
|
||||
*this.handshake = NotificationsInSubstreamHandshake::Flush;
|
||||
return Poll::Pending
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
NotificationsInSubstreamHandshake::Sent => {
|
||||
match Stream::poll_next(this.socket.as_mut(), cx) {
|
||||
|
||||
@@ -1967,8 +1967,9 @@ impl<B: BlockT + 'static, H: ExHashT> Future for NetworkWorker<B, H> {
|
||||
}
|
||||
}
|
||||
},
|
||||
Poll::Ready(SwarmEvent::Dialing(peer_id)) =>
|
||||
trace!(target: "sub-libp2p", "Libp2p => Dialing({:?})", peer_id),
|
||||
Poll::Ready(SwarmEvent::Dialing(peer_id)) => {
|
||||
trace!(target: "sub-libp2p", "Libp2p => Dialing({:?})", peer_id)
|
||||
},
|
||||
Poll::Ready(SwarmEvent::IncomingConnection { local_addr, send_back_addr }) => {
|
||||
trace!(target: "sub-libp2p", "Libp2p => IncomingConnection({},{}))",
|
||||
local_addr, send_back_addr);
|
||||
@@ -2007,9 +2008,10 @@ impl<B: BlockT + 'static, H: ExHashT> Future for NetworkWorker<B, H> {
|
||||
.inc();
|
||||
}
|
||||
},
|
||||
Poll::Ready(SwarmEvent::UnknownPeerUnreachableAddr { address, error }) =>
|
||||
Poll::Ready(SwarmEvent::UnknownPeerUnreachableAddr { address, error }) => {
|
||||
trace!(target: "sub-libp2p", "Libp2p => UnknownPeerUnreachableAddr({}): {}",
|
||||
address, error),
|
||||
address, error)
|
||||
},
|
||||
Poll::Ready(SwarmEvent::ListenerClosed { reason, addresses }) => {
|
||||
if let Some(metrics) = this.metrics.as_ref() {
|
||||
metrics.listeners_local_addresses.sub(addresses.len() as u64);
|
||||
|
||||
@@ -135,8 +135,9 @@ impl<TBlock: BlockT> RequestHandler<TBlock> {
|
||||
let IncomingRequest { peer, payload, pending_response } = request;
|
||||
|
||||
match self.handle_request(payload, pending_response) {
|
||||
Ok(()) =>
|
||||
debug!(target: "sync", "Handled grandpa warp sync request from {}.", peer),
|
||||
Ok(()) => {
|
||||
debug!(target: "sync", "Handled grandpa warp sync request from {}.", peer)
|
||||
},
|
||||
Err(e) => debug!(
|
||||
target: "sync",
|
||||
"Failed to handle grandpa warp sync request from {}: {}",
|
||||
|
||||
Reference in New Issue
Block a user