mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 21:41:12 +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:
@@ -87,10 +87,9 @@ where
|
||||
|
||||
/// This implementation is required, because of the weird api requirements around `BlockImport`.
|
||||
#[async_trait::async_trait]
|
||||
impl<Block: BlockT, T, Transaction> ClientBlockImportExt<Block> for std::sync::Arc<T>
|
||||
impl<Block: BlockT, T> ClientBlockImportExt<Block> for std::sync::Arc<T>
|
||||
where
|
||||
for<'r> &'r T: BlockImport<Block, Error = ConsensusError, Transaction = Transaction>,
|
||||
Transaction: Send + 'static,
|
||||
for<'r> &'r T: BlockImport<Block, Error = ConsensusError>,
|
||||
T: Send + Sync,
|
||||
{
|
||||
async fn import(&mut self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError> {
|
||||
@@ -153,7 +152,6 @@ where
|
||||
RA: Send,
|
||||
B: Send + Sync,
|
||||
E: Send,
|
||||
<Self as BlockImport<Block>>::Transaction: Send,
|
||||
{
|
||||
async fn import(&mut self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError> {
|
||||
let (header, extrinsics) = block.deconstruct();
|
||||
|
||||
@@ -49,11 +49,7 @@ impl<'a, A, B> BlockBuilderExt
|
||||
for sc_block_builder::BlockBuilder<'a, substrate_test_runtime::Block, A, B>
|
||||
where
|
||||
A: ProvideRuntimeApi<substrate_test_runtime::Block> + 'a,
|
||||
A::Api: BlockBuilderApi<substrate_test_runtime::Block>
|
||||
+ ApiExt<
|
||||
substrate_test_runtime::Block,
|
||||
StateBackend = backend::StateBackendFor<B, substrate_test_runtime::Block>,
|
||||
>,
|
||||
A::Api: BlockBuilderApi<substrate_test_runtime::Block> + ApiExt<substrate_test_runtime::Block>,
|
||||
B: backend::Backend<substrate_test_runtime::Block>,
|
||||
{
|
||||
fn push_transfer(
|
||||
|
||||
@@ -816,10 +816,8 @@ fn test_witness(proof: StorageProof, root: crate::Hash) {
|
||||
let db: sp_trie::MemoryDB<crate::Hashing> = proof.into_memory_db();
|
||||
let backend = sp_state_machine::TrieBackendBuilder::<_, crate::Hashing>::new(db, root).build();
|
||||
let mut overlay = sp_state_machine::OverlayedChanges::default();
|
||||
let mut cache = sp_state_machine::StorageTransactionCache::<_, _>::default();
|
||||
let mut ext = sp_state_machine::Ext::new(
|
||||
&mut overlay,
|
||||
&mut cache,
|
||||
&backend,
|
||||
#[cfg(feature = "std")]
|
||||
None,
|
||||
|
||||
Reference in New Issue
Block a user