Introduce mockable `ChainSync` object for testing (#12480)
* Introduce mockable `ChainSync` object for testing `mockall` allows to mock `ChainSync` and to verify that the calls made to `ChaiSync` are firstly executed at all, that they're executed in correct order and with correct parameters. This allows to verify, e.g., that delegating calls directly to `ChainSync` from `NetworkService` still calls the correct functions with correct arguments even if `Protocol` middleman is removed. * Add Cargo.lock * Fix tests * Update client/network/Cargo.toml Co-authored-by:Bastian Köcher <git@kchr.de> * Update Cargo.lock * Fix clippy and documentation Co-authored-by:
Bastian Köcher <git@kchr.de> Co-authored-by: parity-processbot <>
Showing
- substrate/Cargo.lock 58 additions, 0 deletionssubstrate/Cargo.lock
- substrate/client/network/common/src/sync.rs 8 additions, 6 deletionssubstrate/client/network/common/src/sync.rs
- substrate/client/network/src/protocol.rs 1 addition, 1 deletionsubstrate/client/network/src/protocol.rs
- substrate/client/network/src/service.rs 2 additions, 0 deletionssubstrate/client/network/src/service.rs
- substrate/client/network/src/service/chainsync_tests.rs 339 additions, 0 deletionssubstrate/client/network/src/service/chainsync_tests.rs
- substrate/client/network/sync/Cargo.toml 1 addition, 0 deletionssubstrate/client/network/sync/Cargo.toml
- substrate/client/network/sync/src/lib.rs 19 additions, 16 deletionssubstrate/client/network/sync/src/lib.rs
- substrate/client/network/sync/src/mock.rs 118 additions, 0 deletionssubstrate/client/network/sync/src/mock.rs
Please register or sign in to comment