Skip to main content

soil_client/import/queue/
mock.rs

1// This file is part of Soil.
2
3// Copyright (C) Soil contributors.
4// Copyright (C) Parity Technologies (UK) Ltd.
5// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
6
7use super::*;
8
9mockall::mock! {
10	pub ImportQueueHandle<B: BlockT> {}
11
12	impl<B: BlockT> ImportQueueService<B> for ImportQueueHandle<B> {
13		fn import_blocks(&mut self, origin: BlockOrigin, blocks: Vec<IncomingBlock<B>>);
14		fn import_justifications(
15			&mut self,
16			who: RuntimeOrigin,
17			hash: B::Hash,
18			number: NumberFor<B>,
19			justifications: Justifications,
20		);
21	}
22}
23
24mockall::mock! {
25	pub ImportQueue<B: BlockT> {}
26
27	#[async_trait::async_trait]
28	impl<B: BlockT> ImportQueue<B> for ImportQueue<B> {
29		fn service(&self) -> Box<dyn ImportQueueService<B>>;
30		fn service_ref(&mut self) -> &mut dyn ImportQueueService<B>;
31		fn poll_actions<'a>(&mut self, cx: &mut futures::task::Context<'a>, link: &dyn Link<B>);
32		async fn run(self, link: &'__mockall_link dyn Link<B>);
33	}
34}