Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
));
}
#[async_std::test]
async fn select_headers_to_prove_fails_to_use_existing_ancient_relay_block() {
assert_eq!(
select_headers_to_prove((220_u32, 10_u32, 200_u32, 100_u32), 100_u32,)
.await
.map_err(drop),
Ok((true, HeaderId(220, 220), HeaderId(200, 200))),
);
}
#[async_std::test]
async fn select_headers_to_prove_is_able_to_use_existing_recent_relay_block() {
assert_eq!(
select_headers_to_prove((40_u32, 10_u32, 200_u32, 100_u32), 100_u32,)
.await
.map_err(drop),
Ok((false, HeaderId(10, 10), HeaderId(100, 100))),
);
}
#[async_std::test]
async fn select_headers_to_prove_uses_new_relay_block() {
assert_eq!(
select_headers_to_prove((20_u32, 10_u32, 200_u32, 100_u32), 200_u32,)
.await
.map_err(drop),
Ok((true, HeaderId(20, 20), HeaderId(200, 200))),
);
}