Skip to content
Snippets Groups Projects
Commit 99335419 authored by Marcio Diaz's avatar Marcio Diaz
Browse files

Use get_light_header in in_mem.

parent 89a20f1a
...@@ -32,7 +32,9 @@ use crate::error; ...@@ -32,7 +32,9 @@ use crate::error;
use crate::backend::{self, NewBlockState, StorageCollection, ChildStorageCollection}; use crate::backend::{self, NewBlockState, StorageCollection, ChildStorageCollection};
use crate::light; use crate::light;
use crate::leaves::LeafSet; use crate::leaves::LeafSet;
use crate::blockchain::{self, BlockStatus, HeaderBackend, well_known_cache_keys::Id as CacheKeyId}; use crate::blockchain::{
self, BlockStatus, HeaderBackend, LightHeader, well_known_cache_keys::Id as CacheKeyId
};
struct PendingBlock<B: BlockT> { struct PendingBlock<B: BlockT> {
block: StoredBlock<B>, block: StoredBlock<B>,
...@@ -222,7 +224,8 @@ impl<Block: BlockT> Blockchain<Block> { ...@@ -222,7 +224,8 @@ impl<Block: BlockT> Blockchain<Block> {
None None
} else { } else {
let route = crate::blockchain::tree_route( let route = crate::blockchain::tree_route(
|id| self.header(id)?.ok_or_else(|| error::Error::UnknownBlock(format!("{:?}", id))), |id| self.get_light_header(id)?
.ok_or_else(|| error::Error::UnknownBlock(format!("{:?}", id))),
BlockId::Hash(best_hash), BlockId::Hash(best_hash),
BlockId::Hash(*header.parent_hash()), BlockId::Hash(*header.parent_hash()),
)?; )?;
...@@ -293,6 +296,14 @@ impl<Block: BlockT> HeaderBackend<Block> for Blockchain<Block> { ...@@ -293,6 +296,14 @@ impl<Block: BlockT> HeaderBackend<Block> for Blockchain<Block> {
})) }))
} }
fn set_light_header(&self, _data: LightHeader<Block>) {
unimplemented!()
}
fn get_light_header(&self, _id: BlockId<Block>) -> error::Result<Option<LightHeader<Block>>> {
unimplemented!()
}
fn info(&self) -> blockchain::Info<Block> { fn info(&self) -> blockchain::Info<Block> {
let storage = self.storage.read(); let storage = self.storage.read();
blockchain::Info { blockchain::Info {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment