use tp_runtime::{
generic::BlockId,
traits::{Block as BlockT},
};
use crate::{StorageProof, ChangesProof};
use tetcore_storage::{ChildInfo, StorageKey, PrefixedStorageKey};
pub trait ProofProvider<Block: BlockT> {
fn read_proof(
&self,
id: &BlockId<Block>,
keys: &mut dyn Iterator<Item=&[u8]>,
) -> tp_blockchain::Result<StorageProof>;
fn read_child_proof(
&self,
id: &BlockId<Block>,
child_info: &ChildInfo,
keys: &mut dyn Iterator<Item=&[u8]>,
) -> tp_blockchain::Result<StorageProof>;
fn execution_proof(
&self,
id: &BlockId<Block>,
method: &str,
call_data: &[u8],
) -> tp_blockchain::Result<(Vec<u8>, StorageProof)>;
fn header_proof(&self, id: &BlockId<Block>) -> tp_blockchain::Result<(Block::Header, StorageProof)>;
fn key_changes_proof(
&self,
first: Block::Hash,
last: Block::Hash,
min: Block::Hash,
max: Block::Hash,
storage_key: Option<&PrefixedStorageKey>,
key: &StorageKey,
) -> tp_blockchain::Result<ChangesProof<Block::Header>>;
}