Skip to content
This repository was archived by the owner on Oct 3, 2025. It is now read-only.

Commit f5f286d

Browse files
authored
Remove unused parent_hash in OverlayedChanges::into_storage_changes (paritytech#11011)
Ref paritytech#10922 (comment) CC @cheme
1 parent 3d9361d commit f5f286d

5 files changed

Lines changed: 2 additions & 13 deletions

File tree

primitives/api/proc-macro/src/impl_runtime_apis.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ fn generate_runtime_api_base_structures() -> Result<TokenStream> {
301301

302302
self.changes.replace(Default::default()).into_storage_changes(
303303
backend,
304-
parent_hash,
305304
self.storage_transaction_cache.replace(Default::default()),
306305
state_version,
307306
)

primitives/state-machine/src/ext.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,6 @@ where
660660
self.overlay
661661
.drain_storage_changes(
662662
self.backend,
663-
Default::default(),
664663
self.storage_transaction_cache,
665664
Default::default(), // using any state
666665
)
@@ -680,12 +679,7 @@ where
680679
}
681680
let changes = self
682681
.overlay
683-
.drain_storage_changes(
684-
self.backend,
685-
Default::default(),
686-
self.storage_transaction_cache,
687-
state_version,
688-
)
682+
.drain_storage_changes(self.backend, self.storage_transaction_cache, state_version)
689683
.expect(EXT_NOT_ALLOWED_TO_FAIL);
690684
self.backend
691685
.commit(

primitives/state-machine/src/overlayed_changes/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,21 +500,19 @@ impl OverlayedChanges {
500500
pub fn into_storage_changes<B: Backend<H>, H: Hasher>(
501501
mut self,
502502
backend: &B,
503-
parent_hash: H::Out,
504503
mut cache: StorageTransactionCache<B::Transaction, H>,
505504
state_version: StateVersion,
506505
) -> Result<StorageChanges<B::Transaction, H>, DefaultError>
507506
where
508507
H::Out: Ord + Encode + 'static,
509508
{
510-
self.drain_storage_changes(backend, parent_hash, &mut cache, state_version)
509+
self.drain_storage_changes(backend, &mut cache, state_version)
511510
}
512511

513512
/// Drain all changes into a [`StorageChanges`] instance. Leave empty overlay in place.
514513
pub fn drain_storage_changes<B: Backend<H>, H: Hasher>(
515514
&mut self,
516515
backend: &B,
517-
_parent_hash: H::Out,
518516
mut cache: &mut StorageTransactionCache<B::Transaction, H>,
519517
state_version: StateVersion,
520518
) -> Result<StorageChanges<B::Transaction, H>, DefaultError>

primitives/state-machine/src/testing.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ where
179179
pub fn commit_all(&mut self) -> Result<(), String> {
180180
let changes = self.overlay.drain_storage_changes::<_, _>(
181181
&self.backend,
182-
Default::default(),
183182
&mut Default::default(),
184183
self.state_version,
185184
)?;

utils/frame/try-runtime/cli/src/commands/follow_chain.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ where
150150
let storage_changes = changes
151151
.drain_storage_changes(
152152
&state_ext.backend,
153-
Default::default(),
154153
&mut Default::default(),
155154
// Note that in case a block contains a runtime upgrade,
156155
// state version could potentially be incorrect here,

0 commit comments

Comments
 (0)