mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 07:41:08 +00:00
fix test
This commit is contained in:
@@ -194,6 +194,11 @@ impl<V: 'static + Verifier<Block>, D> Peer<V, D> {
|
||||
io.to_disconnect.clone()
|
||||
}
|
||||
|
||||
fn with_io<'a, F, U>(&'a self, f: F) -> U where F: FnOnce(&mut TestIo<'a>) -> U {
|
||||
let mut io = TestIo::new(&self.queue, None);
|
||||
f(&mut io)
|
||||
}
|
||||
|
||||
/// Produce the next pending message to send to another peer.
|
||||
fn pending_message(&self) -> Option<TestPacket> {
|
||||
self.flush();
|
||||
|
||||
@@ -90,12 +90,14 @@ fn sync_after_fork_works() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore] // reinstate when import queue handlers dispatch announce messages.
|
||||
fn own_blocks_are_announced() {
|
||||
::env_logger::init().ok();
|
||||
let mut net = TestNet::new(3);
|
||||
net.sync(); // connect'em
|
||||
net.peer(0).generate_blocks(1, BlockOrigin::Own, |builder| builder.bake().unwrap());
|
||||
|
||||
let header = net.peer(0).client().header(&BlockId::Number(1)).unwrap().unwrap();
|
||||
net.peer(0).with_io(|io| net.peer(0).sync.on_block_imported(io, header.hash(), &header));
|
||||
net.sync();
|
||||
assert_eq!(net.peer(0).client.backend().blockchain().info().unwrap().best_number, 1);
|
||||
assert_eq!(net.peer(1).client.backend().blockchain().info().unwrap().best_number, 1);
|
||||
|
||||
Reference in New Issue
Block a user