client/finality-grandpa: Add regression test for observer polling network (was #4778) (#4795)

* client/finality-grandpa: Add regression test observer polling network

Ensure `Future` implementation of `ObserverWork` is polling its
`NetworkBridge`. Regression test for bug introduced in d9837d7dd and
fixed in 504b4e89e.

When polled, `NetworkBridge` forwards reputation change requests from
the `GossipValidator` to the underlying `dyn Network`. This test
triggers a reputation change by calling `GossipValidator::validate` with
an invalid gossip message. After polling the `ObserverWork` which should
poll the `NetworkBridge`, the reputation change should be forwarded to
the test network.

* Nits

Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
Gavin Wood
2020-01-31 19:12:03 +00:00
committed by GitHub
parent 111207afe8
commit adde404e41
5 changed files with 94 additions and 7 deletions
+1
View File
@@ -5572,6 +5572,7 @@ dependencies = [
name = "sc-finality-grandpa"
version = "0.8.0"
dependencies = [
"assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"finality-grandpa 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fork-tree 2.0.0",