diff --git a/crates/sp-domains-fraud-proof/src/execution_prover.rs b/crates/sp-domains-fraud-proof/src/execution_prover.rs index 3414d1c282..7dadc50344 100644 --- a/crates/sp-domains-fraud-proof/src/execution_prover.rs +++ b/crates/sp-domains-fraud-proof/src/execution_prover.rs @@ -58,7 +58,7 @@ where // TODO: avoid using the String API specified by `execution_method()` // https://github.com/paritytech/substrate/discussions/11095 if let Some((delta, post_delta_root)) = delta_changes { - let delta_backend = create_delta_backend(trie_backend, delta, post_delta_root); + let delta_backend = create_delta_backend(trie_backend, &delta, post_delta_root); sp_state_machine::prove_execution_on_trie_backend( &delta_backend, &mut Default::default(), diff --git a/domains/client/block-builder/src/custom_api.rs b/domains/client/block-builder/src/custom_api.rs index ae73f735ab..2d9fd452a6 100644 --- a/domains/client/block-builder/src/custom_api.rs +++ b/domains/client/block-builder/src/custom_api.rs @@ -38,7 +38,7 @@ pub struct CollectedStorageChanges { /// and `delta`. pub fn create_delta_backend<'a, S, H>( backend: &'a TrieBackend, - delta: BackendTransaction, + delta: &'a BackendTransaction, post_delta_root: H::Out, ) -> TrieBackend, H> where @@ -51,7 +51,7 @@ where fn create_delta_backend_with_maybe_delta<'a, S, H>( backend: &'a TrieBackend, - maybe_delta: Option>, + maybe_delta: Option<&'a BackendTransaction>, post_delta_root: H::Out, ) -> TrieBackend, H> where @@ -76,7 +76,7 @@ where H: 'a + Hasher, { backend: &'a S, - delta: Option>, + delta: Option<&'a BackendTransaction>, _phantom: PhantomData, } @@ -87,7 +87,7 @@ where { fn get(&self, key: &H::Out, prefix: Prefix) -> Result, String> { if let Some(db) = &self.delta - && let Some(v) = HashDB::get(db, key, prefix) + && let Some(v) = HashDB::get(*db, key, prefix) { Ok(Some(v)) } else { @@ -294,10 +294,7 @@ where .map_err(sp_blockchain::Error::RuntimeCode)?; let mut overlayed_changes = OverlayedChanges::default(); let (state_root, delta) = if let Some(changes) = &self.maybe_storage_changes { - ( - changes.transaction_storage_root, - Some(changes.transaction.clone()), - ) + (changes.transaction_storage_root, Some(&changes.transaction)) } else { (*trie_backend.root(), None) };