This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Remove all stale on_runtime_upgrade
hooks in the runtime
#10650
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1ac7971
Remove all stale on_runtime_upgrade hooks in the runtime
kianenigma 680a7d8
add docs
kianenigma 500824a
cleanup
kianenigma 899fb3f
fix warn
kianenigma 7e5af1d
fix more warnings
kianenigma 8f96bad
Master.into()
kianenigma edbe7a6
fix offence test
kianenigma 882992e
overwrite the damn UItest
kianenigma 401372b
Merge branch 'master' of github.com:paritytech/substrate into kiz-rem…
kianenigma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
frame/support/test/tests/pallet_ui/genesis_default_not_satisfied.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
error[E0277]: the trait bound `pallet::GenesisConfig: std::default::Default` is not satisfied | ||
--> $DIR/genesis_default_not_satisfied.rs:22:18 | ||
--> tests/pallet_ui/genesis_default_not_satisfied.rs:22:18 | ||
| | ||
22 | impl<T: Config> GenesisBuild<T> for GenesisConfig {} | ||
| ^^^^^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `pallet::GenesisConfig` | ||
| | ||
note: required by a bound in `GenesisBuild` | ||
--> $DIR/hooks.rs:297:36 | ||
--> $WORKSPACE/frame/support/src/traits/hooks.rs | ||
| | ||
297 | pub trait GenesisBuild<T, I = ()>: Default + sp_runtime::traits::MaybeSerializeDeserialize { | ||
| pub trait GenesisBuild<T, I = ()>: Default + sp_runtime::traits::MaybeSerializeDeserialize { | ||
| ^^^^^^^ required by this bound in `GenesisBuild` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,14 +33,13 @@ mod benchmarking; | |
pub mod mock; | ||
#[cfg(test)] | ||
mod tests; | ||
pub mod weights; | ||
|
||
mod functions; | ||
mod impl_nonfungibles; | ||
mod types; | ||
pub use types::*; | ||
|
||
mod migration; | ||
pub mod migration; | ||
pub mod weights; | ||
|
||
use codec::{Decode, Encode, HasCompact}; | ||
use frame_support::traits::{BalanceStatus::Reserved, Currency, ReservableCurrency}; | ||
|
@@ -52,6 +51,7 @@ use sp_runtime::{ | |
use sp_std::prelude::*; | ||
|
||
pub use pallet::*; | ||
pub use types::*; | ||
pub use weights::WeightInfo; | ||
|
||
#[frame_support::pallet] | ||
|
@@ -316,13 +316,6 @@ pub mod pallet { | |
Unapproved, | ||
} | ||
|
||
#[pallet::hooks] | ||
impl<T: Config<I>, I: 'static> Hooks<BlockNumberFor<T>> for Pallet<T, I> { | ||
fn on_runtime_upgrade() -> frame_support::weights::Weight { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hamidra please confirm this is not used. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is needed for the next statemine/statemint release to add ClassAccount storage to uniques. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay @hamidra you need to make sure that you we manually add this migration now to the next release of statemine. cc @joepetrowski |
||
migration::migrate_to_v1::<T, I, Self>() | ||
} | ||
} | ||
|
||
impl<T: Config<I>, I: 'static> Pallet<T, I> { | ||
/// Get the owner of the asset instance, if the asset exists. | ||
pub fn owner(class: T::ClassId, instance: T::InstanceId) -> Option<T::AccountId> { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@athei please confirm this is not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would I know if anyone uses this? It will migrate when appropriate. The code isn't there for fun.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well this is exactly the reason why we are removing these hooks, because it is not clear who and when uses them.
My rephrased question is: are there any teams that you are aware of that would be affected if we remove this code?
note that I will re-expose this migration code as a standalone function, in case anyone needs it so they can manually apply it, and mark the PR is
release-note
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its fine then. But I really much preferred the old way where it just worked. Won't I get all these dead code warnings after this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will see the outcome soon.