Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6e10966
Create sp-weights crate to store weight primitives
KiChjang Sep 7, 2022
5e4dd1d
Merge remote-tracking branch 'origin/master' into kckyeung/sp-weights
KiChjang Sep 8, 2022
43ab5e6
Fix templates
KiChjang Sep 8, 2022
e5bace0
Fix templates
KiChjang Sep 8, 2022
87a1ff4
Fixes
KiChjang Sep 8, 2022
6b1c48c
Fixes
KiChjang Sep 8, 2022
f17e1b2
cargo fmt
KiChjang Sep 8, 2022
48a88cc
Fixes
KiChjang Sep 8, 2022
19ae7dd
Fixes
KiChjang Sep 8, 2022
4728a95
Use deprecated type alias instead of deprecated unit types
KiChjang Sep 8, 2022
70b56ec
Use deprecated subtraits instead of deprecated hollow new traits
KiChjang Sep 8, 2022
8415f32
Fixes
KiChjang Sep 8, 2022
39ba7b9
Allow deprecation in macro expansion
KiChjang Sep 8, 2022
d7bcf1f
Add missing where clause during call macro expansion
KiChjang Sep 9, 2022
fb468e9
cargo fmt
KiChjang Sep 9, 2022
c51cde5
Fixes
KiChjang Sep 9, 2022
e4c44fa
cargo fmt
KiChjang Sep 9, 2022
ef1be20
Fixes
KiChjang Sep 9, 2022
12c3e06
Fixes
KiChjang Sep 9, 2022
1937813
Fixes
KiChjang Sep 9, 2022
531986c
Fixes
KiChjang Sep 9, 2022
51b7b21
Move FRAME-specific weight files back to frame_support
KiChjang Sep 12, 2022
d43dd83
Fixes
KiChjang Sep 12, 2022
88223b7
Merge branch 'master' into kckyeung/sp-weights
shawntabrizi Sep 12, 2022
d029aa4
Update frame/support/src/dispatch.rs
KiChjang Sep 13, 2022
029f121
Update frame/support/src/dispatch.rs
KiChjang Sep 13, 2022
f6dc099
Update frame/support/src/dispatch.rs
KiChjang Sep 13, 2022
56407a5
Add missing header
KiChjang Sep 13, 2022
3c5455a
Rewrite module docs
KiChjang Sep 13, 2022
eca462f
Merge remote-tracking branch 'origin/master' into kckyeung/sp-weights
KiChjang Sep 13, 2022
3f8e33f
Fixes
KiChjang Sep 13, 2022
785fe95
Fixes
KiChjang Sep 13, 2022
8bcc6f1
Fixes
KiChjang Sep 13, 2022
9e235f9
Fixes
KiChjang Sep 13, 2022
1880f7a
cargo fmt
KiChjang Sep 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cargo fmt
  • Loading branch information
KiChjang committed Sep 9, 2022
commit fb468e98ba5a0d1c18b5033c1e924f790ee165a7
10 changes: 8 additions & 2 deletions frame/support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ pub mod weights {
}
#[deprecated = "Trait has moved to `frame_support::dispatch`"]
pub trait OneOrMany<T>: dispatch::OneOrMany<T> {
fn into_iter(self) -> Self::Iter where Self: Sized {
fn into_iter(self) -> Self::Iter
where
Self: Sized,
{
<Self as dispatch::OneOrMany<T>>::into_iter(self)
}
}
Expand All @@ -152,7 +155,10 @@ pub mod weights {
}
#[deprecated = "Trait has moved to `frame_support::dispatch`"]
pub trait WithPostDispatchInfo: dispatch::WithPostDispatchInfo {
fn with_weight(self, actual_weight: Weight) -> dispatch::DispatchErrorWithPostInfo where Self: Sized {
fn with_weight(self, actual_weight: Weight) -> dispatch::DispatchErrorWithPostInfo
where
Self: Sized,
{
<Self as dispatch::WithPostDispatchInfo>::with_weight(self, actual_weight)
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm attempting to try a novel way to deprecate types that have been moved, and one of the ways that I can think of is to create new subtraits and type alias and immediately deprecating them, telling the FRAME dev that the trait/type has been moved to another location.

Would be nice if I get some eye balls on this to ensure that this is worthwhile to pursue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here is to create code that still works like the old way, but would emit a deprecation warning about the usage. This would make it easier for people to migrate over to the new location by allowing them to do so at a time of their choosing, while still having code that works.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks decent to me, just not sure when and based on what criteria are we going to remove the old code? we also have not removed the old macros now for more than a year and it is unclear to me when we are going to.

If there's no clear answer to this, I think it is also reasonable to just break the code downstream instead of keeping a lot of duplicate code around.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could stick a comment stating that the old methods will be removed once we get to date x.

Expand Down