Substrate companion for #8163 (#2492)

* Substrate companion for #8163

https://github.com/paritytech/substrate/pull/8163

* "Update Substrate"

Co-authored-by: parity-processbot <>
This commit is contained in:
Bastian Köcher
2021-02-22 15:52:43 +01:00
committed by GitHub
parent 44519d1d2c
commit 2584c121fb
11 changed files with 277 additions and 238 deletions
+13 -12
View File
@@ -891,7 +891,8 @@ impl CandidateBackingJob {
.as_ref()?
.sign(self.keystore.clone(), statement)
.await
.ok()?;
.ok()
.flatten()?;
self.metrics.on_statement_signed();
Some(signed)
}
@@ -1600,7 +1601,7 @@ mod tests {
&test_state.signing_context,
2,
&public2.into(),
).await.expect("should be signed");
).await.ok().flatten().expect("should be signed");
let signed_b = SignedFullStatement::sign(
&test_state.keystore,
@@ -1608,7 +1609,7 @@ mod tests {
&test_state.signing_context,
5,
&public1.into(),
).await.expect("should be signed");
).await.ok().flatten().expect("should be signed");
let statement = CandidateBackingMessage::Statement(test_state.relay_parent, signed_a.clone());
@@ -1742,7 +1743,7 @@ mod tests {
&test_state.signing_context,
2,
&public2.into(),
).await.expect("should be signed");
).await.ok().flatten().expect("should be signed");
let signed_b = SignedFullStatement::sign(
&test_state.keystore,
@@ -1750,7 +1751,7 @@ mod tests {
&test_state.signing_context,
5,
&public1.into(),
).await.expect("should be signed");
).await.ok().flatten().expect("should be signed");
let signed_c = SignedFullStatement::sign(
&test_state.keystore,
@@ -1758,7 +1759,7 @@ mod tests {
&test_state.signing_context,
3,
&public3.into(),
).await.expect("should be signed");
).await.ok().flatten().expect("should be signed");
let statement = CandidateBackingMessage::Statement(test_state.relay_parent, signed_a.clone());
virtual_overseer.send(FromOverseer::Communication{ msg: statement }).await;
@@ -1895,7 +1896,7 @@ mod tests {
&test_state.signing_context,
2,
&public2.into(),
).await.expect("should be signed");
).await.ok().flatten().expect("should be signed");
let signed_b = SignedFullStatement::sign(
&test_state.keystore,
@@ -1903,7 +1904,7 @@ mod tests {
&test_state.signing_context,
2,
&public2.into(),
).await.expect("should be signed");
).await.ok().flatten().expect("should be signed");
let signed_c = SignedFullStatement::sign(
&test_state.keystore,
@@ -1911,7 +1912,7 @@ mod tests {
&test_state.signing_context,
0,
&public0.into(),
).await.expect("should be signed");
).await.ok().flatten().expect("should be signed");
let statement = CandidateBackingMessage::Statement(test_state.relay_parent, signed_a.clone());
@@ -2224,7 +2225,7 @@ mod tests {
&test_state.signing_context,
2,
&validator2.into(),
).await.expect("should be signed");
).await.ok().flatten().expect("should be signed");
// Send in a `Statement` with a candidate.
let statement = CandidateBackingMessage::Statement(
@@ -2362,7 +2363,7 @@ mod tests {
&test_state.signing_context,
2,
&public2.into(),
).await.expect("should be signed");
).await.ok().flatten().expect("should be signed");
// Send in a `Statement` with a candidate.
let statement = CandidateBackingMessage::Statement(
@@ -2504,7 +2505,7 @@ mod tests {
&test_state.signing_context,
2,
&public2.into(),
).await.expect("should be signed");
).await.ok().flatten().expect("should be signed");
let statement = CandidateBackingMessage::Statement(
test_state.relay_parent,