Use header metadata in babe verify. (#3756)

* Use header_metadata in verify.

* Log hash in header_metadata error.

* Fix naming, error.
This commit is contained in:
Marcio Diaz
2019-10-05 10:43:19 +02:00
committed by Gavin Wood
parent 789ead9beb
commit 65ef193ec8
4 changed files with 7 additions and 8 deletions
+2 -2
View File
@@ -42,7 +42,7 @@ use client::backend::NewBlockState;
use client::blockchain::{well_known_cache_keys, HeaderBackend};
use client::{ForkBlocks, ExecutionStrategies};
use client::backend::{StorageCollection, ChildStorageCollection};
use client::error::Result as ClientResult;
use client::error::{Result as ClientResult, Error as ClientError};
use codec::{Decode, Encode};
use hash_db::{Hasher, Prefix};
use kvdb::{KeyValueDB, DBTransaction};
@@ -417,7 +417,7 @@ impl<Block: BlockT> HeaderMetadata<Block> for BlockchainDb<Block> {
header_metadata.clone(),
);
header_metadata
}).ok_or(client::error::Error::UnknownBlock("header not found in db".to_owned()))
}).ok_or(ClientError::UnknownBlock(format!("header not found in db: {}", hash)))
})
}
+1 -1
View File
@@ -207,7 +207,7 @@ impl<Block: BlockT> HeaderMetadata<Block> for LightStorage<Block> {
header_metadata.clone(),
);
header_metadata
}).ok_or(ClientError::UnknownBlock("header not found in db".to_owned()))
}).ok_or(ClientError::UnknownBlock(format!("header not found in db: {}", hash)))
})
}