Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
02b6a57
Update to u64
shawntabrizi Mar 28, 2020
1b8a181
Update bin/node/runtime/src/lib.rs
shawntabrizi Mar 29, 2020
f204dcb
Update weights
shawntabrizi Mar 29, 2020
6d60384
Fix test
shawntabrizi Mar 29, 2020
010fccb
Extra zeros to make gas 1:1 with weight
shawntabrizi Apr 8, 2020
b3e96eb
Merge branch 'master' into shawntabrizi-update-weights
shawntabrizi Apr 8, 2020
d365ecf
Merge branch 'master' into shawntabrizi-update-weights
shawntabrizi Apr 8, 2020
25f8dd4
initial impl DbWeight
shawntabrizi Apr 8, 2020
cfae9bf
Merge branch 'master' into shawntabrizi-update-weights
shawntabrizi Apr 9, 2020
6ed3496
Update weights for balances
shawntabrizi Apr 9, 2020
d239667
multiply all weights by 1_000
shawntabrizi Apr 9, 2020
04ff18d
Fix tests
shawntabrizi Apr 9, 2020
189cbb1
backfill trait
shawntabrizi Apr 9, 2020
42814c0
Missed one
shawntabrizi Apr 9, 2020
f65bbd4
more fixes
shawntabrizi Apr 9, 2020
a16ae55
Fix tests
shawntabrizi Apr 9, 2020
c3ad5fb
update fixed 64 docs
shawntabrizi Apr 10, 2020
428ec84
introduce fixed 128
shawntabrizi Apr 10, 2020
30e4a21
Revert "introduce fixed 128"
shawntabrizi Apr 10, 2020
bec986c
Revert "update fixed 64 docs"
shawntabrizi Apr 10, 2020
9cfb1bc
Merge branch 'master' into shawntabrizi-update-weights
shawntabrizi Apr 13, 2020
06197b4
Add fixed 128
shawntabrizi Apr 13, 2020
0c94fc9
fix types
shawntabrizi Apr 13, 2020
d3f4b4b
Fix test
shawntabrizi Apr 13, 2020
62f6a9b
Fix tests
shawntabrizi Apr 13, 2020
0ce0870
Update impls.rs
shawntabrizi Apr 13, 2020
ab5b865
fix tests
shawntabrizi Apr 13, 2020
b704be9
better comment
shawntabrizi Apr 13, 2020
275d40d
types update
shawntabrizi Apr 13, 2020
d07a623
Use new fixed128 api
shawntabrizi Apr 13, 2020
ec2f0c8
import in test
shawntabrizi Apr 13, 2020
2ccd439
another type update
shawntabrizi Apr 13, 2020
5329496
fix test in example
shawntabrizi Apr 13, 2020
d078d31
remove weight test
shawntabrizi Apr 13, 2020
b371c23
fix warning
shawntabrizi Apr 13, 2020
f0187d9
Simplify RuntimeDbWeight
shawntabrizi Apr 14, 2020
96b217a
Update bin/node/runtime/src/impls.rs
shawntabrizi Apr 14, 2020
fef18aa
Apply suggestions from code review
shawntabrizi Apr 14, 2020
9045ec7
Merge branch 'master' into shawntabrizi-update-weights
shawntabrizi Apr 14, 2020
0e77b6f
improved api @apopiak
shawntabrizi Apr 14, 2020
c204c88
Merge branch 'master' into shawntabrizi-update-weights
shawntabrizi Apr 14, 2020
c7af453
Remove `SimpleDispatchInfo::default()`
shawntabrizi Apr 14, 2020
21f91f1
little more clean up of default weight
shawntabrizi Apr 14, 2020
3b57909
Introduce MINIMUM_WEIGHT const
shawntabrizi Apr 14, 2020
8edc50a
Update bin/node/runtime/src/impls.rs
shawntabrizi Apr 14, 2020
afc5f99
Update test to show trend more clearly
shawntabrizi Apr 14, 2020
1d7f0b8
Merge branch 'shawntabrizi-update-weights' of https://github.com/pari…
shawntabrizi Apr 14, 2020
8af5797
test nit
shawntabrizi Apr 14, 2020
8b4e349
Update fixed64.rs
shawntabrizi Apr 14, 2020
e0a2be8
More fixes
shawntabrizi Apr 14, 2020
f9907bb
missed one
shawntabrizi Apr 14, 2020
d164555
More test fixes
shawntabrizi Apr 14, 2020
2baf8f6
Update lib.rs
shawntabrizi Apr 14, 2020
5564ec0
Merge branch 'master' into shawntabrizi-update-weights
shawntabrizi Apr 14, 2020
e830b11
Update Cargo.lock
shawntabrizi Apr 14, 2020
cf75a56
Bump spec version
shawntabrizi Apr 15, 2020
98dbf61
Clean and fic block weight tests.
kianenigma Apr 15, 2020
8fd3293
fix on-initialize weights
kianenigma Apr 15, 2020
8da68dc
Fix warnings
shawntabrizi Apr 15, 2020
1d6a9f2
fix warnings
shawntabrizi Apr 15, 2020
b1c0914
Merge branch 'master' into shawntabrizi-update-weights
shawntabrizi Apr 15, 2020
6b3fb93
Merge branch 'master' into shawntabrizi-update-weights
shawntabrizi Apr 15, 2020
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
More fixes
  • Loading branch information
shawntabrizi committed Apr 14, 2020
commit e0a2be82733dc4f5247114d20826b1c514fb9ef5
8 changes: 4 additions & 4 deletions frame/indices/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ decl_module! {
/// - One reserve operation.
/// - One event.
/// # </weight>
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
fn claim(origin, index: T::AccountIndex) {
let who = ensure_signed(origin)?;

Expand Down Expand Up @@ -149,7 +149,7 @@ decl_module! {
/// - One transfer operation.
/// - One event.
/// # </weight>
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
fn transfer(origin, new: T::AccountId, index: T::AccountIndex) {
let who = ensure_signed(origin)?;
ensure!(who != new, Error::<T>::NotTransfer);
Expand Down Expand Up @@ -180,7 +180,7 @@ decl_module! {
/// - One reserve operation.
/// - One event.
/// # </weight>
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
fn free(origin, index: T::AccountIndex) {
let who = ensure_signed(origin)?;

Expand Down Expand Up @@ -209,7 +209,7 @@ decl_module! {
/// - Up to one reserve operation.
/// - One event.
/// # </weight>
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
fn force_transfer(origin, new: T::AccountId, index: T::AccountIndex) {
ensure_root(origin)?;

Expand Down
2 changes: 1 addition & 1 deletion frame/recovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ decl_module! {
/// # <weight>
/// - One storage mutation to check account is recovered by `who`. O(1)
/// # </weight>
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
fn cancel_recovered(origin, account: T::AccountId) {
let who = ensure_signed(origin)?;
// Check `who` is allowed to make a call on behalf of `account`
Expand Down
10 changes: 5 additions & 5 deletions frame/scored-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ decl_module! {
///
/// The `index` parameter of this function must be set to
/// the index of the transactor in the `Pool`.
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
pub fn submit_candidacy(origin) {
let who = ensure_signed(origin)?;
ensure!(!<CandidateExists<T, I>>::contains_key(&who), Error::<T, I>::AlreadyInPool);
Expand Down Expand Up @@ -297,7 +297,7 @@ decl_module! {
///
/// The `index` parameter of this function must be set to
/// the index of the transactor in the `Pool`.
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
pub fn withdraw_candidacy(
origin,
index: u32
Expand All @@ -317,7 +317,7 @@ decl_module! {
///
/// The `index` parameter of this function must be set to
/// the index of `dest` in the `Pool`.
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
pub fn kick(
origin,
dest: <T::Lookup as StaticLookup>::Source,
Expand All @@ -342,7 +342,7 @@ decl_module! {
///
/// The `index` parameter of this function must be set to
/// the index of the `dest` in the `Pool`.
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
pub fn score(
origin,
dest: <T::Lookup as StaticLookup>::Source,
Expand Down Expand Up @@ -383,7 +383,7 @@ decl_module! {
/// (this happens each `Period`).
///
/// May only be called from root.
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
pub fn change_member_count(origin, count: u32) {
ensure_root(origin)?;
<MemberCount<I>>::put(&count);
Expand Down
2 changes: 1 addition & 1 deletion frame/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,7 @@ decl_module! {
/// This can be called from any origin.
///
/// - `stash`: The stash account to reap. Its balance must be zero.
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
fn reap_stash(_origin, stash: T::AccountId) {
ensure!(T::Currency::total_balance(&stash).is_zero(), Error::<T>::FundedTarget);
Self::kill_stash(&stash)?;
Expand Down
2 changes: 1 addition & 1 deletion frame/sudo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ decl_module! {
/// - Limited storage reads.
/// - One DB change.
/// # </weight>
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
fn set_key(origin, new: <T::Lookup as StaticLookup>::Source) {
// This is a public call, so we ensure that the origin is some signed account.
let sender = ensure_signed(origin)?;
Expand Down
4 changes: 2 additions & 2 deletions frame/support/test/tests/decl_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mod module1 {
pub struct Module<T: Trait<I>, I: Instance = DefaultInstance> for enum Call
where origin: <T as system::Trait>::Origin
{
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
pub fn fail(_origin) -> frame_support::dispatch::DispatchResult {
Err(Error::<T, I>::Something.into())
}
Expand All @@ -59,7 +59,7 @@ mod module2 {
pub struct Module<T: Trait> for enum Call
where origin: <T as system::Trait>::Origin
{
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
pub fn fail(_origin) -> frame_support::dispatch::DispatchResult {
Err(Error::<T>::Something.into())
}
Expand Down
2 changes: 1 addition & 1 deletion frame/support/test/tests/reserved_keyword/on_initialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ macro_rules! reserved {

frame_support::decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
#[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
fn $reserved(_origin) -> dispatch::DispatchResult { unreachable!() }
}
}
Expand Down
3 changes: 2 additions & 1 deletion frame/timestamp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@
//!
//! ```
//! use frame_support::{decl_module, dispatch};
//! use frame_support::weights::{SimpleDispatchInfo, MINIMUM_WEIGHT};
//! # use pallet_timestamp as timestamp;
//! use frame_system::{self as system, ensure_signed};
//!
//! pub trait Trait: timestamp::Trait {}
//!
//! decl_module! {
//! pub struct Module<T: Trait> for enum Call where origin: T::Origin {
//! #[weight = frame_support::weights::SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
//! #[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
//! pub fn get_time(origin) -> dispatch::DispatchResult {
//! let _sender = ensure_signed(origin)?;
//! let _now = <timestamp::Module<T>>::get();
Expand Down