Migrate assets pallet to new macros (#7984)

* Prep: move things around to suggested order

* Compiles, tests pass

* cleanup

* cleanup 2

* Fix dead doc-links

* Add back documentation for storage items

* Switch benchmarks to use `Event` rather than `RawEvent`.

* Update frame/assets/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* reviwe feedback

* Obey line length checks

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
David
2021-02-04 11:23:20 +00:00
committed by GitHub
parent 8e49a8a6a6
commit a32f2b9271
3 changed files with 916 additions and 851 deletions
+10 -6
View File
@@ -1874,11 +1874,15 @@ pub mod pallet_prelude {
///
/// ## Upgrade guidelines:
///
/// 1. export metadata of the pallet for later checks
/// 2. generate the template upgrade for the pallet provided by decl_storage with environment
/// variable `PRINT_PALLET_UPGRADE`: `PRINT_PALLET_UPGRADE=1 cargo check -p my_pallet`
/// This template can be used as information it contains all information for storages, genesis
/// config and genesis build.
/// 1. Export the metadata of the pallet for later checks
/// - run your node with the pallet active
/// - query the metadata using the `state_getMetadata` RPC and curl, or use
/// `subsee -p <PALLET_NAME> > meta.json`
/// 2. generate the template upgrade for the pallet provided by decl_storage
/// with environment variable `PRINT_PALLET_UPGRADE`:
/// `PRINT_PALLET_UPGRADE=1 cargo check -p my_pallet` This template can be
/// used as information it contains all information for storages, genesis
/// config and genesis build.
/// 3. reorganize pallet to have trait `Config`, `decl_*` macros, `ValidateUnsigned`,
/// `ProvideInherent`, `Origin` all together in one file. Suggested order:
/// * Config,
@@ -1925,7 +1929,7 @@ pub mod pallet_prelude {
/// impl<T: Config> Pallet<T> {
/// }
/// ```
/// and write inside all the call in decl_module with a few changes in the signature:
/// and write inside all the calls in decl_module with a few changes in the signature:
/// - origin must now be written completely, e.g. `origin: OriginFor<T>`
/// - result type must be `DispatchResultWithPostInfo`, you need to write it and also you might
/// need to put `Ok(().into())` at the end or the function.