Zebra/zebra-network/src
Alfredo Garcia 56636c85fc
Add missing tests for mempool inbound requests (#2769)
* Use `MockService` in inbound test

Refactor the `mempool_requsets_for_transactions` test so that it uses a
`MockService` instead of the `mock_peer_set` function.

* Use `MockService` in the basic mempool test

Refactor the `mempool_service_basic` test so that it uses a
`MockService` instead of the `mock_peer_set` helper function.

* Remove the `mock_peer_set` helper function

It is not used anymore, since the usages were replaced with
`MockService`s.

* add tests for mempool inbound requests

* Use MockService for transaction verifier

* Refactor creation of mock `peer_set`

Use the same style as the mock transaction verifier.

* Derive `Eq` for `zebra_network::Request`

Make it easy to use the `MockService::expect_request` method.

* Return mocked peer set service from `setup`

Allow it to be used to respond to requests.

* Add bindings for the transaction used for testing

Allow them to be moved into futures later.

* Respond to transaction download request

Make sure that the test transaction appears to the mempool as if it had
been downloaded by the peer set service.

* Assert that no unexpected requests were received

Check that the mempool doesn't send unexpected requests to the peer set
service.

* add tests for mempool inbound requests

* Use MockService for transaction verifier

* add missing `expect_no_requests` to `mempool_advertise_transaction_ids` test

Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@gmail.com>
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2021-09-23 10:17:06 -03:00
..
address_book Security: Zebra should stop gossiping unreachable addresses to other nodes, Action: re-deploy all nodes (#2392) 2021-06-29 05:12:27 +00:00
config Use the default port for configured listen addresses with no port (#2043) 2021-04-21 23:14:29 +00:00
meta_addr Security: Zebra should stop gossiping unreachable addresses to other nodes, Action: re-deploy all nodes (#2392) 2021-06-29 05:12:27 +00:00
peer Add a `ChainTipChange` type to `await` chain tip changes (#2715) 2021-09-01 22:31:16 +00:00
peer_set Create a helper `MockService` type to help with writing tests that use mock `tower::Service`s (#2748) 2021-09-21 17:44:59 +00:00
protocol Add missing tests for mempool inbound requests (#2769) 2021-09-23 10:17:06 -03:00
address_book.rs Security: Zebra should stop gossiping unreachable addresses to other nodes, Action: re-deploy all nodes (#2392) 2021-06-29 05:12:27 +00:00
config.rs README: update known issues and add inbound network ports (#2373) 2021-06-23 08:10:21 -03:00
constants.rs Update version strings for v1.0.0 alpha.17 release (#2750) 2021-09-14 17:41:50 +00:00
isolated.rs Add a `ChainTipChange` type to `await` chain tip changes (#2715) 2021-09-01 22:31:16 +00:00
lib.rs Standardise clippy lints and require docs (#2238) 2021-06-04 08:48:40 +10:00
meta_addr.rs Security: Zebra should stop gossiping unreachable addresses to other nodes, Action: re-deploy all nodes (#2392) 2021-06-29 05:12:27 +00:00
peer.rs Security: stop gossiping temporary inbound remote addresses to peers 2021-05-14 23:45:42 +10:00
peer_set.rs Security: Limit reconnection rate to individual peers (#2275) 2021-06-18 09:30:44 -03:00
policies.rs Fix sync algorithm. (#887) 2020-08-12 16:48:01 -07:00
protocol.rs Refactor protocol into internal, external modules. 2019-11-27 05:06:01 -05:00
timestamp_collector.rs Gossip dynamic local listener ports to peers (#2277) 2021-06-23 07:59:06 +10:00