Update jsonrpsee reference (#1049)

* update jsonrpsee

* test

* Revert "test"

This reverts commit 2b69652ab92ff0d9649088c76faed2c94384540d.
This commit is contained in:
Svyatoslav Nikolsky
2021-07-19 14:03:59 +03:00
committed by Bastian Köcher
parent 4e18bff37c
commit 6103fbe40b
6 changed files with 34 additions and 24 deletions
@@ -108,12 +108,18 @@ async fn prepare_initialization_data<SourceChain: Chain>(
.map_err(|err| format!("Failed to subscribe to {} justifications: {:?}", SourceChain::NAME, err))?;
// Read next justification - the header that it finalizes will be used as initial header.
let justification = justifications.next().await.ok_or_else(|| {
format!(
"Failed to read {} justification from the stream: stream has ended unexpectedly",
SourceChain::NAME,
)
})?;
let justification = justifications
.next()
.await
.map_err(|err| err.to_string())
.and_then(|justification| justification.ok_or_else(|| "stream has ended unexpectedly".into()))
.map_err(|err| {
format!(
"Failed to read {} justification from the stream: {}",
SourceChain::NAME,
err,
)
})?;
// Read initial header.
let justification: GrandpaJustification<SourceChain::Header> = Decode::decode(&mut &justification.0[..])