pub fn block_id_to_lookup_key<Block>(
	db: &KeyValueDB,
	key_lookup_col: Option<u32>,
	id: BlockId<Block>
) -> Result<Option<Vec<u8>>, client::error::Error> where
	Block: BlockT,
	::runtime_primitives::traits::NumberFor<Block>: As<u64>,
{
	let res = match id {
		BlockId::Number(n) => db.get(
			key_lookup_col,
			number_index_key(n).as_ref(),
		),
		BlockId::Hash(h) => db.get(key_lookup_col, h.as_ref()),
	};

	res.map(|v| v.map(|v| v.into_vec())).map_err(db_err)
}
/// Convert block id to block lookup key.
/// block lookup key is the DB-key header, block and justification are stored under.
/// looks up lookup key by hash from DB as necessary.
Convert block id to block lookup key.
block lookup key is the DB-key header, block and justification are stored under.
looks up lookup key by hash from DB as necessary.
Convert block id to block lookup key . block lookup key is the DB - key header block and justification are stored under . looks up lookup key by hash from DB as necessary .
pub fn block_id_to_lookup_key<Block>(
	db: &KeyValueDB,
	key_lookup_col: Option<u32>,
	id: BlockId<Block>
) -> Result<Option<Vec<u8>>, client::error::Error> where
	Block: BlockT,
	::runtime_primitives::traits::NumberFor<Block>: As<u64>,
{
	let res = match id {
		BlockId::Number(n) => db.get(
			key_lookup_col,
			number_index_key(n).as_ref(),
		),
		BlockId::Hash(h) => db.get(key_lookup_col, h.as_ref()),
	};
	res.map(|v| v.map(|v| v.into_vec())).map_err(db_err)
}
pub fn block_id_to_lookup_key < Block > ( db : & KeyValueDB , key_lookup_col : Option < u32 > , id : BlockId < Block > ) -> Result < Option < Vec < u8 > > , client :: error :: Error > where Block : BlockT , :: runtime_primitives :: traits :: NumberFor < Block > : As < u64 > , { let res = match id { BlockId :: Number ( n ) => db . get ( key_lookup_col , number_index_key ( n ) . as_ref ( ) , ) , BlockId :: Hash ( h ) => db . get ( key_lookup_col , h . as_ref ( ) ) , } ; res . map ( | v | v . map ( | v | v . into_vec ( ) ) ) . map_err ( db_err ) }
Convert block id to block lookup key.
Convert block id to block lookup key .
db
&KeyValueDB
key_lookup_col
Option<u32>
id
BlockId<Block>
db
&KeyValueDB
key_lookup_col
Option<u32>
id
BlockId<Block>