Commit e2547f50 authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

Improve handling of unset `StorageVersion` (#13417)



* Improve handling of unset `StorageVersion`

When a user is forgetting to set the storage version in a pallet and calls
`current_storage_version` to compare it against the `on_chain_storage_version` it will now fail to
compile the code. Before the pallet macro just returned `StorageVersion::default()` for
`current_storage_version` leading to potential issues with migrations. Besides that it also checks
in `post_upgrade` that the pallet storage version was upgraded and thus, no migration was missed.

* Use correct `Cargo.lock`

* Fixes

* Fix test

* Update frame/support/test/tests/pallet.rs

* Ensure we don't set a storage version when the pallet is missing the attribute

* Fix merge conflict

* Update frame/support/procedural/src/pallet/expand/hooks.rs

Co-authored-by: default avatarRoman Useinov <[email protected]>

* Update frame/support/procedural/src/pallet/expand/hooks.rs

Co-authored-by: default avatarRoman Useinov <[email protected]>

* Fix compilation

* Do not run everything with `try-runtime`

* Fix test

* Apply suggestions from code review

Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>

* Fix `no-metadata-docs`

---------

Co-authored-by: default avatarRoman Useinov <[email protected]>
Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
Co-authored-by: parity-processbot <>
parent 0e55bace
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment