1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use sp_blockchain::{Error, HeaderBackend, HeaderMetadata};
use sc_client_api::{BlockBackend, ProofProvider};
use sp_runtime::traits::{Block as BlockT, BlockIdTo};
pub trait Client<Block: BlockT>: HeaderBackend<Block> + ProofProvider<Block> + BlockIdTo<Block, Error = Error>
+ BlockBackend<Block> + HeaderMetadata<Block, Error = Error> + Send + Sync
{}
impl<Block: BlockT, T> Client<Block> for T
where
T: HeaderBackend<Block> + ProofProvider<Block> + BlockIdTo<Block, Error = Error>
+ BlockBackend<Block> + HeaderMetadata<Block, Error = Error> + Send + Sync
{}
pub trait FinalityProofProvider<Block: BlockT>: Send + Sync {
fn prove_finality(&self, for_block: Block::Hash, request: &[u8]) -> Result<Option<Vec<u8>>, Error>;
}
impl<Block: BlockT> FinalityProofProvider<Block> for () {
fn prove_finality(&self, _for_block: Block::Hash, _request: &[u8]) -> Result<Option<Vec<u8>>, Error> {
Ok(None)
}
}