feat(p2p): refactor downloaders and add peer id to the result (#410)

* feat(p2p): refactor downloaders and add peer id to the result

* rm unused import

* fix tests

* clean up deps

* Update crates/interfaces/src/p2p/error.rs

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* add split fn

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Roman Krasiuk
2022-12-13 18:14:45 +02:00
committed by GitHub
parent 2b1bb05ca3
commit 5057e8ec0a
28 changed files with 220 additions and 320 deletions

View File

@ -67,7 +67,7 @@ async fn test_get_body() {
let res = fetch0.get_block_body(vec![block_hash]).await;
assert!(res.is_ok());
let blocks = res.unwrap();
let blocks = res.unwrap().1;
assert_eq!(blocks.len(), 1);
let expected = BlockBody { transactions: block.body, ommers: block.ommers };
assert_eq!(blocks[0], expected);
@ -114,7 +114,7 @@ async fn test_get_header() {
let res = fetch0.get_headers(req).await;
assert!(res.is_ok());
let headers = res.unwrap().0;
let headers = res.unwrap().1 .0;
assert_eq!(headers.len(), 1);
assert_eq!(headers[0], header);
}