Refactor OverlayedChanges (#5989)
* Hide internal structure of OverlayChanges * Fix tests for OverlayChanges refactor * Do not clone pending changes Discarding prospective changes should be equivalent as a state machine is not to be called with peding changes. This will be replaced by a storage transaction that is rolled back before executing the call the second time removing this constraint. * Doc fixes * Remove overlong line * Revert "Do not clone pending changes" This reverts commit 4799491f4ac16f8517287a0fcf4a3f84ad56f46e. * Deduplicate chield tries returned from child_infos() * Remove redundant type annotation * Avoid changing the storage root in tests * Preserve extrinsic indices in trie build test * Swap order of comitted and prospective in fn child_infos This is only for consistency and does not impact the result. * Rename set_pending to replace_pending for clearity
Showing
- substrate/primitives/state-machine/src/changes_trie/build.rs 50 additions, 88 deletionssubstrate/primitives/state-machine/src/changes_trie/build.rs
- substrate/primitives/state-machine/src/ext.rs 17 additions, 32 deletionssubstrate/primitives/state-machine/src/ext.rs
- substrate/primitives/state-machine/src/lib.rs 13 additions, 23 deletionssubstrate/primitives/state-machine/src/lib.rs
- substrate/primitives/state-machine/src/overlayed_changes.rs 59 additions, 9 deletionssubstrate/primitives/state-machine/src/overlayed_changes.rs
- substrate/primitives/state-machine/src/testing.rs 11 additions, 13 deletionssubstrate/primitives/state-machine/src/testing.rs
Please register or sign in to comment