paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

Improve `storage_alias` and make `UnlockAndUnreserveAllFunds` independent of the pallet #14773

Closed bkchr closed 1 year ago

bkchr commented 1 year ago

This pull request is doing two things:

  1. It improve storage_alias by making it more generic over the prefix to use. Currently storage_alias tries to guess based on the generics if the user wants to use the pallet name or a fixed identifier as prefix. This pull requests changes the macro to take an additional attribute that tells it what prefix type the user wants. Besides that a third prefix type is added, a type that implements Get<&'static str> can also be provided as prefix. See the docs in the code for more information on how this works.

  2. pallet_democracy::UnlockAndUnreserveAllFunds is made independent of the presence of the pallet-democracy pallet. This means that the migration can be used without the pallet still being used in the runtime. The user only needs to implement the UnlockConfig for some type that is then passed to UnlockAndUnreserveAllFunds to forward certain information that are required by the migration.

Besides this the pull request also puts some tests in frame-support into their own file to clean up the lib.rs.

bkchr commented 1 year ago

bot fmt

command-bot[bot] commented 1 year ago

@bkchr https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3395811 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 32-876d6c0b-ef05-4d17-aa17-7892c304e213 to cancel this command or bot cancel to cancel all commands in this pull request.

command-bot[bot] commented 1 year ago

@bkchr Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3395811 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3395811/artifacts/download.

bkchr commented 1 year ago

bot merge

paritytech-processbot[bot] commented 1 year ago

Waiting for commit status.