Use [u8; 4] for well known cache keys (#2152)

* Use [u8; 4] for well known cache keys

* Use type alias
This commit is contained in:
Stanislav Tkach
2019-04-01 02:56:49 +03:00
committed by DemiMarie-parity
parent 3dfda381d5
commit fbbd79e778
15 changed files with 53 additions and 42 deletions
+2 -1
View File
@@ -23,6 +23,7 @@ use runtime_primitives::{generic::BlockId, Justification, StorageOverlay, Childr
use runtime_primitives::traits::{Block as BlockT, NumberFor};
use state_machine::backend::Backend as StateBackend;
use state_machine::ChangesTrieStorage as StateChangesTrieStorage;
use consensus::well_known_cache_keys;
use hash_db::Hasher;
use trie::MemoryDB;
@@ -75,7 +76,7 @@ pub trait BlockImportOperation<Block, H> where
) -> error::Result<()>;
/// Update cached data.
fn update_cache(&mut self, cache: HashMap<Vec<u8>, Vec<u8>>);
fn update_cache(&mut self, cache: HashMap<well_known_cache_keys::Id, Vec<u8>>);
/// Inject storage data into the database.
fn update_db_storage(&mut self, update: <Self::State as StateBackend<H>>::Transaction) -> error::Result<()>;
/// Inject storage data into the database replacing any existing data.