mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 04:37:57 +00:00
Set StateBackend::Transaction to PrefixedMemoryDB (#14612)
* Yep * Try to get it working everywhere * Make `from_raw_storage` start with an empty db * More fixes! * Make everything compile * Fix `child_storage_root` * Fix after merge * Cleanups * Update primitives/state-machine/src/overlayed_changes/mod.rs Co-authored-by: Davide Galassi <davxy@datawok.net> * Review comments * Fix issues * Silence warning * FMT * Clippy --------- Co-authored-by: Davide Galassi <davxy@datawok.net>
This commit is contained in:
@@ -36,17 +36,11 @@ use sp_storage::{ChildInfo, StorageData, StorageKey};
|
||||
|
||||
use crate::{blockchain::Backend as BlockchainBackend, UsageInfo};
|
||||
|
||||
pub use sp_state_machine::{Backend as StateBackend, KeyValueStates};
|
||||
pub use sp_state_machine::{Backend as StateBackend, BackendTransaction, KeyValueStates};
|
||||
|
||||
/// Extracts the state backend type for the given backend.
|
||||
pub type StateBackendFor<B, Block> = <B as Backend<Block>>::State;
|
||||
|
||||
/// Extracts the transaction for the given state backend.
|
||||
pub type TransactionForSB<B, Block> = <B as StateBackend<HashingFor<Block>>>::Transaction;
|
||||
|
||||
/// Extracts the transaction for the given backend.
|
||||
pub type TransactionFor<B, Block> = TransactionForSB<StateBackendFor<B, Block>, Block>;
|
||||
|
||||
/// Describes which block import notification stream should be notified.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum ImportNotificationAction {
|
||||
@@ -181,7 +175,7 @@ pub trait BlockImportOperation<Block: BlockT> {
|
||||
/// Inject storage data into the database.
|
||||
fn update_db_storage(
|
||||
&mut self,
|
||||
update: TransactionForSB<Self::State, Block>,
|
||||
update: BackendTransaction<HashingFor<Block>>,
|
||||
) -> sp_blockchain::Result<()>;
|
||||
|
||||
/// Set genesis state. If `commit` is `false` the state is saved in memory, but is not written
|
||||
|
||||
Reference in New Issue
Block a user