pass correct header column to read_meta again (#827)

* pass correct header column to read_meta again

fixes #826

* make COLUMN_META exist in a single place

* pass COLUMN_META as arg for more consistency with other db utils

* remove unused import
This commit is contained in:
snd
2018-09-28 04:43:18 +09:00
committed by Gav Wood
parent 0d284c0195
commit 41a6f54c4a
3 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -113,7 +113,7 @@ pub fn new_client<E, S, Block>(
}
mod columns {
pub const META: Option<u32> = Some(0);
pub const META: Option<u32> = ::utils::COLUMN_META;
pub const STATE: Option<u32> = Some(1);
pub const STATE_META: Option<u32> = Some(2);
pub const HASH_LOOKUP: Option<u32> = Some(3);
@@ -150,7 +150,7 @@ pub struct BlockchainDb<Block: BlockT> {
impl<Block: BlockT> BlockchainDb<Block> {
fn new(db: Arc<KeyValueDB>) -> Result<Self, client::error::Error> {
let meta = read_meta::<Block>(&*db, columns::META)?;
let meta = read_meta::<Block>(&*db, columns::META, columns::HEADER)?;
let leaves = LeafSet::read_from_db(&*db, columns::META, meta_keys::LEAF_PREFIX)?;
Ok(BlockchainDb {
db,
@@ -397,7 +397,7 @@ impl<Block: BlockT> Backend<Block> {
///
/// The pruning window is how old a block must be before the state is pruned.
pub fn new(config: DatabaseSettings, canonicalization_delay: u64) -> Result<Self, client::error::Error> {
let db = open_database(&config, "full")?;
let db = open_database(&config, columns::META, "full")?;
Backend::from_kvdb(db as Arc<_>, config.pruning, canonicalization_delay)
}