Zebra/zebra-test/src
Janito Vaqueiro Ferreira Filho ec207cfa95
Ignore unexpected block responses to fix error cascade when synchronizing blocks (#3374)
* Refactor setup of `Connection` test vectors

Add a `new_test_connection` helper function to create a `Connection`
instance that's ready for testing.

* Check that no inbound requests are sent

Return the mock inbound service from `new_test_connection` and assert
that no requests were sent to it in any test.

* Replace `&mut Vec<u8>` with an `mpsc` channel

Make it easier to run the connection task in the background, i.e.,
remove any lifetime constraints from the borrowed buffer so that
`Connection` is `'static`.

It's now also easier to assert on individual messages sent from the
`Connection` instance.

* Make `MockServiceBuilder::finish` public

Allow test functions to be generic when creating a `MockService`, so
that caller functions actually determine if the type of `MockService`
assertions.

* Move `new_test_connection` to parent module

Make it more generic so that it can be used later in property tests as
well.

* Derive `Eq` and `PartialEq` for network `Response`

Allow intercepted `Response` instances to be easily compared in tests.

* Test block request cancel causes an error cascade

This is the scenario that caused the block synchronizer to reset every
few minutes, which made it considerably slower.

* Ignore unexpected block responses

It's likely that it's just a response for a previously cancelled block
request.
2022-01-20 08:14:16 +00:00
..
vectors Checking of Sprout anchors in non-finalized state (#3123) 2021-12-09 16:50:26 +00:00
command.rs Fix typos (#3055) 2021-11-12 19:30:22 +00:00
lib.rs Enforce Rust edition 2021 (#3332) 2022-01-14 12:10:18 +00:00
mock_service.rs Ignore unexpected block responses to fix error cascade when synchronizing blocks (#3374) 2022-01-20 08:14:16 +00:00
net.rs Release Blocker? Disable IPv6 tests when $ZEBRA_SKIP_IPV6_TESTS is set (#2405) 2021-06-29 11:20:32 +10:00
network_addr.rs Parse received addrv2 messages (#3022) 2021-11-12 00:25:23 +00:00
prelude.rs Check MAX_BLOCK_SIGOPS in the block verifier (#3049) 2021-11-15 20:55:32 +00:00
service_extensions.rs Use `MockedClientHandle` in other tests (#3241) 2021-12-22 06:13:26 +10:00
transcript.rs Update to Tokio 1.13.0 (#2994) 2021-11-02 18:46:57 +00:00
vectors.rs Async Halo2 verifier service (#2645) 2021-11-17 13:26:15 +10:00
zip0143.rs Always compute sighash with librustzcash (#2469) 2021-07-09 09:55:08 +10:00
zip0243.rs Fix bug in sighash for coinbase transactions (#2459) 2021-07-08 16:05:40 -03:00
zip0244.rs Update shared NU5 dependencies, set the NU5 testnet activation network upgrade parameters (#2825) 2021-10-06 11:08:41 +10:00