substrate
substrate copied to clipboard
Fix leaf block removal in the backend
This PR introduces a new remove method for the leaves set maintained by the backend.
The remove, import, and finalization methods return types were named/renamed
-
RemoveOutcome -
ImportDisplaced->ImportOutcome -
FinalizationDisplaced->FinalizationOutcome
This naming/renaming has been done to better reflect what the operations are actually doing. That is, for example:
- an
importalways adds a new leaf, but not always removes its parent from the leaves set (the parent may not be a leaf already) - a
removenot always removes a leaf and not always adds its parent to the set (it should be the last child to add the parent as a leaf).
The naming also better fits in the undo operations that were improved and better tested.
The new remove method has been immediately used to fix the remove_leaf_block backend method.
Before it was using revert and that has not the effect we actually need here.