partner_chains_mock_data_sources/
stake_distribution.rs

1use sidechain_domain::*;
2use sp_block_participation::inherent_data::BlockParticipationDataSource;
3
4/// Mocked stake distribution data source that returns empty data
5pub struct StakeDistributionDataSourceMock;
6
7impl StakeDistributionDataSourceMock {
8	/// Creates new data source
9	pub fn new() -> Self {
10		Self
11	}
12}
13
14#[async_trait::async_trait]
15impl BlockParticipationDataSource for StakeDistributionDataSourceMock {
16	async fn get_stake_pool_delegation_distribution_for_pools(
17		&self,
18		_epoch: McEpochNumber,
19		_pool_hashes: &[MainchainKeyHash],
20	) -> Result<StakeDistribution, Box<dyn std::error::Error + Send + Sync>> {
21		Ok(StakeDistribution::default())
22	}
23}