partner_chains_mock_data_sources/
native_token.rs

1use crate::Result;
2use async_trait::async_trait;
3use sidechain_domain::*;
4use sp_native_token_management::{MainChainScripts, NativeTokenManagementDataSource};
5
6/// Mock native token data source that serves constant data
7#[derive(Default)]
8pub struct NativeTokenDataSourceMock;
9
10impl NativeTokenDataSourceMock {
11	/// Creates new mocked native token data source
12	pub fn new() -> Self {
13		Self
14	}
15}
16
17#[async_trait]
18impl NativeTokenManagementDataSource for NativeTokenDataSourceMock {
19	async fn get_total_native_token_transfer(
20		&self,
21		_after_block: Option<McBlockHash>,
22		_to_block: McBlockHash,
23		_scripts: MainChainScripts,
24	) -> Result<NativeTokenAmount> {
25		Ok(NativeTokenAmount(1000))
26	}
27}