overseer: send_msg should not return an error (#1995)

* send_message should not return an error

* Apply suggestions from code review

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>

* s/send_logging_error/send_and_log_error

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
This commit is contained in:
Andronik Ordian
2020-11-23 12:42:14 +01:00
committed by GitHub
parent 8cdb063f72
commit 69b103b1d5
21 changed files with 330 additions and 462 deletions
+2 -2
View File
@@ -690,7 +690,7 @@ where
RuntimeApiRequest::CandidateEvents(tx),
));
ctx.send_message(msg.into()).await?;
ctx.send_message(msg.into()).await;
Ok(rx.await??)
}
@@ -858,7 +858,7 @@ where
{
let (tx, rx) = oneshot::channel();
ctx.send_message(AllMessages::ChainApi(ChainApiMessage::BlockNumber(block_hash, tx))).await?;
ctx.send_message(AllMessages::ChainApi(ChainApiMessage::BlockNumber(block_hash, tx))).await;
Ok(rx.await??.map(|number| number).unwrap_or_default())
}
@@ -171,7 +171,7 @@ async fn runtime_api_request<T>(
relay_parent,
request,
))
).await?;
).await;
receiver.await.map_err(Into::into)
}
+2 -2
View File
@@ -143,13 +143,13 @@ where
let (sender, receiver) = futures::channel::oneshot::channel();
overseer.wait_for_activation(parent_header_hash, sender).await?;
overseer.wait_for_activation(parent_header_hash, sender).await;
receiver.await.map_err(|_| Error::ClosedChannelAwaitingActivation)??;
let (sender, receiver) = futures::channel::oneshot::channel();
overseer.send_msg(AllMessages::Provisioner(
ProvisionerMessage::RequestInherentData(parent_header_hash, sender),
)).await?;
)).await;
let mut timeout = futures_timer::Delay::new(PROPOSE_TIMEOUT).fuse();