Create sp-weights crate to store weight primitives (#12219)

* Create sp-weights crate to store weight primitives

* Fix templates

* Fix templates

* Fixes

* Fixes

* cargo fmt

* Fixes

* Fixes

* Use deprecated type alias instead of deprecated unit types

* Use deprecated subtraits instead of deprecated hollow new traits

* Fixes

* Allow deprecation in macro expansion

* Add missing where clause during call macro expansion

* cargo fmt

* Fixes

* cargo fmt

* Fixes

* Fixes

* Fixes

* Fixes

* Move FRAME-specific weight files back to frame_support

* Fixes

* Update frame/support/src/dispatch.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/support/src/dispatch.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/support/src/dispatch.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Add missing header

* Rewrite module docs

* Fixes

* Fixes

* Fixes

* Fixes

* cargo fmt

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Keith Yeung
2022-09-13 21:23:44 +08:00
committed by GitHub
parent 214eb25f87
commit 30e7b1e8cd
69 changed files with 1316 additions and 1225 deletions
+5 -2
View File
@@ -49,12 +49,15 @@ use sp_std::{marker::PhantomData, prelude::*, result};
use frame_support::{
codec::{Decode, Encode, MaxEncodedLen},
dispatch::{DispatchError, DispatchResultWithPostInfo, Dispatchable, PostDispatchInfo},
dispatch::{
DispatchError, DispatchResultWithPostInfo, Dispatchable, GetDispatchInfo, Pays,
PostDispatchInfo,
},
ensure,
traits::{
Backing, ChangeMembers, EnsureOrigin, Get, GetBacking, InitializeMembers, StorageVersion,
},
weights::{GetDispatchInfo, Pays, Weight},
weights::Weight,
};
#[cfg(test)]
+3 -2
View File
@@ -18,9 +18,10 @@
use super::{Event as CollectiveEvent, *};
use crate as pallet_collective;
use frame_support::{
assert_noop, assert_ok, parameter_types,
assert_noop, assert_ok,
dispatch::Pays,
parameter_types,
traits::{ConstU32, ConstU64, GenesisBuild, StorageVersion},
weights::Pays,
Hashable,
};
use frame_system::{EventRecord, Phase};