* Record pallet indices in CallMetadata
* Resurrect PalletVersion infrastructure and rename as CrateVersion
* cargo fmt
* Add missing runtime generics to pallet struct
* Fix path to instance
* Fix test
* Fix UI test expectations
* Fix UI test expectations
* Move crate_version function to PalletInfoAccess
* Update UI test expectations
* Add crate_name method to PalletInfo
* Convert path to module name instead of exposing crate name
* cargo fmt
* Keep the double colons when constructing the module name
* Remove unused import
* Update UI test expectations
* Update frame/support/src/traits/metadata.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* Update UI test expectations
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* Move `PalletVersion` away from the crate version
Before this pr, `PalletVersion` was referring to the crate version that
hosted the pallet. This pr introduces a custom `package.metadata.frame`
section in the `Cargo.toml` that can contain a `pallet-version` key
value pair. While the value is expected to be a valid u16. If this
key/value pair isn't given, the version is set to 1.
It also changes the `PalletVersion` declaration. We now only have one
`u16` that represents the version. Not a major/minor/patch version. As
the old `PalletVersion` was starting with the `u16` major, decoding the
old values will work.
* Overhaul the entire implementation
- Drop PalletVersion
- Introduce StorageVersion
- StorageVersion needs to be set in the crate and set for the macros
- Added migration
* Fix migrations
* Review feedback
* Remove unneeded dep
* remove pub consts
* Brings back logging and implements `GetStorageVersion`
* Return weight from migration
* Fmt and remove unused import
* Update frame/support/src/dispatch.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* Update frame/support/src/traits/metadata.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* Run cargo fmt on the whole code base
* Second run
* Add CI check
* Fix compilation
* More unnecessary braces
* Handle weights
* Use --all
* Use correct attributes...
* Fix UI tests
* AHHHHHHHHH
* 🤦
* Docs
* Fix compilation
* 🤷
* Please stop
* 🤦 x 2
* More
* make rustfmt.toml consistent with polkadot
Co-authored-by: André Silva <andrerfosilva@gmail.com>
* Use 'Pallet' struct in construct_runtime.
* Fix genesis and metadata macro.
* Fix 'Pallet' type alias.
* Replace 'Module' with 'Pallet' for all construct_runtime use cases.
* Replace more deprecated 'Module' struct.
* Bring back AllModules and AllPalletsWithSystem type, but deprecate them.
* Replace deprecated 'Module' struct from merge master.
* Minor fix.
* Fix UI tests.
* Revert UI override in derive_no_bound.
* Fix more deprecated 'Module' use from master branch.
* Fix more deprecated 'Module' use from master branch.
* more clear randomness API for BABE
* babe: move randomness utilities to its own file
* node: use babe::RandomnessFromOneEpochAgo in random_seed implementation
* frame-support: annotate randomness trait with block number
* pallet-randomness-collective-flip: fix for new randomness trait
* pallet-society: fix randomness usage
* pallet-lottery: fix randomness usage
* pallet-contracts: fix randomness usage
* pallet-babe: fix randomness usage
we need to track when the current and previous epoch started so that we
know the block number by each existing on-chain was known
* node: fix random_seed
* node-template: fix random_seed
* frame-support: extend docs
* babe: add test for epoch starting block number tracking
* babe: fix epoch randomness docs
* frame: add todos for dealing with randomness api changes
Co-authored-by: André Silva <andrerfosilva@gmail.com>
* Start
* Make macro work
* Rename `ModuleToIndex` to `PalletRuntimeSetup`
Besides the renaming it also adds support getting the name of a pallet
as configured in the runtime.
* Rename it to `PalletInfo`
* Remove accidentally added files
* Some work
* Make everything compile
* Adds a test and fixes some bugs
* Implement ordering for `PalletVersion`
* Apply suggestions from code review
* Review feedback
* Update frame/support/src/dispatch.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* Update frame/support/src/dispatch.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* Fix compilation
* Fix test
* Fix doc test
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>