Function frame_support::storage::migration::move_pallet

source ·
pub fn move_pallet(old_pallet_name: &[u8], new_pallet_name: &[u8])
Expand description

Move all storages from a pallet prefix to another pallet prefix.

Keys used in pallet storages always start with: concat(twox_128(pallet_name), twox_128(storage_name)).

This function will remove all value for which the key start with twox_128(old_pallet_name) and insert them at the key with the start replaced by twox_128(new_pallet_name).

NOTE: The value at the key twox_128(old_pallet_name) is not moved.

§Example

If a pallet named “my_example” has some storages and the pallet is renamed “my_new_example_name”, a migration can be:

move_pallet(b"my_example", b"my_new_example_name");