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
66 commits
Select commit Hold shift + click to select a range
c992d67
Basic weights builder.
tomusdrw Jun 23, 2020
52e2033
Fixing WiP
tomusdrw Jun 24, 2020
350976e
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Jun 25, 2020
01b9aea
Make the tests work.
tomusdrw Jul 1, 2020
201a5ba
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Jul 1, 2020
6c2676d
Fix weights in node/runtime.
tomusdrw Jul 2, 2020
390a359
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Jul 6, 2020
4e11daf
WiP.
tomusdrw Jul 6, 2020
f914485
Update pallets with new weights parameters.
tomusdrw Jul 6, 2020
17ce9a3
Validate returns a Result now.
tomusdrw Jul 7, 2020
44e5981
Count mandatory weight separately.
tomusdrw Jul 7, 2020
141fbfb
DRY
tomusdrw Jul 7, 2020
3f0a2e9
BREAKING: Updating state root, because of the left-over weight-tracki…
tomusdrw Jul 8, 2020
782cc72
Update tests affected by Mandatory tracking.
tomusdrw Jul 8, 2020
8185cb1
Fixing tests.
tomusdrw Jul 9, 2020
1525c76
Fix defaults for simple_max
tomusdrw Jul 9, 2020
9441b00
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Jul 9, 2020
9f3a541
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Jul 10, 2020
2ab1f18
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Jul 16, 2020
f09c6f3
Update frame/system/src/weights.rs
tomusdrw Jul 17, 2020
eb84c74
Rework the API a bit.
tomusdrw Jul 23, 2020
edab564
Fix compilation & tests.
tomusdrw Jul 23, 2020
738ac18
Merge remote-tracking branch 'origin/td-weight-parameters-refactor' i…
tomusdrw Jul 23, 2020
319ee5c
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Jul 23, 2020
da4ff09
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Jul 27, 2020
95e249c
Apply suggestions from code review
tomusdrw Jul 28, 2020
22ef5d3
Add extra docs & rename few things.
tomusdrw Jul 28, 2020
cad3d96
Fix whitespace in ASCII art.
tomusdrw Jul 28, 2020
22fa090
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Jul 28, 2020
eb75ba3
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Jul 30, 2020
98fdb4a
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Jul 31, 2020
a2359eb
Update frame/system/src/limits.rs
tomusdrw Aug 5, 2020
bea4dd0
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Aug 5, 2020
31706c6
Fix max_extrinsic calculations.
tomusdrw Aug 6, 2020
fa3203c
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Aug 18, 2020
e197126
Fix conflicts.
tomusdrw Aug 18, 2020
804bee5
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Aug 20, 2020
f4da99a
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Aug 28, 2020
233a5ff
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Sep 9, 2020
da260bd
Fix compilation.
tomusdrw Sep 9, 2020
91366d9
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Sep 21, 2020
1e1bcf7
Fix new code.
tomusdrw Sep 21, 2020
9b7d331
re-remove generic asset
shawntabrizi Sep 22, 2020
6176f8e
Merge branch 'master' into td-weight-parameters-refactor
gnunicorn Sep 22, 2020
0a138ac
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Sep 23, 2020
b69b3e5
Fix usage.
tomusdrw Sep 23, 2020
d6e7776
Update state root.
tomusdrw Sep 23, 2020
2d8875f
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Sep 28, 2020
6e8ff1d
Update proxy.
tomusdrw Sep 28, 2020
b12359d
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Nov 17, 2020
45c6fe6
Fix tests.
tomusdrw Nov 17, 2020
543891f
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Nov 25, 2020
44946a8
Move weights validity to integrity_test
tomusdrw Nov 27, 2020
2cf0631
Remove redundant BlockWeights.
tomusdrw Nov 27, 2020
6f00731
Add all/non_mandatory comment
tomusdrw Nov 27, 2020
7a8b774
Add test.
tomusdrw Nov 27, 2020
8bc7ca5
Remove fn block_weights
tomusdrw Dec 2, 2020
d115561
Make the macro prettier.
tomusdrw Dec 2, 2020
f18cbab
Fix some docs.
tomusdrw Dec 2, 2020
6e4c35c
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Dec 2, 2020
b4c293c
Merge branch 'master' into td-weight-parameters-refactor
tomusdrw Dec 2, 2020
e2ee2b9
Make max_total behave more predictabily.
tomusdrw Dec 3, 2020
953f845
Add BlockWeights to metadata.
tomusdrw Dec 3, 2020
4854b95
Merge branch 'master' into td-weight-parameters-refactor
shawntabrizi Dec 7, 2020
ddc57b0
fix balances test
gui1117 Dec 8, 2020
ab0ba02
Fix utility test.
tomusdrw Dec 8, 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
Remove fn block_weights
  • Loading branch information
tomusdrw committed Dec 2, 2020
commit 8bc7ca58e175f656a4c038a592658c1ca2ca83df
4 changes: 2 additions & 2 deletions frame/democracy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ decl_module! {
}

/// Enact a proposal from a referendum. For now we just make the weight be the maximum.
#[weight = T::block_weights().max_block]
#[weight = T::BlockWeights::get().max_block]
fn enact_proposal(origin, proposal_hash: T::Hash, index: ReferendumIndex) -> DispatchResult {
ensure_root(origin)?;
Self::do_enact_proposal(proposal_hash, index)
Expand Down Expand Up @@ -1609,7 +1609,7 @@ impl<T: Trait> Module<T> {
/// - Db reads per R: `DepositOf`, `ReferendumInfoOf`
/// # </weight>
fn begin_block(now: T::BlockNumber) -> Result<Weight, DispatchError> {
let max_block_weight = T::block_weights().max_block;
let max_block_weight = T::BlockWeights::get().max_block;
let mut weight = 0;

// pick out another public referendum if it's time.
Expand Down
4 changes: 2 additions & 2 deletions frame/elections-phragmen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ decl_module! {
#[weight = if *has_replacement {
T::WeightInfo::remove_member_with_replacement()
} else {
T::block_weights().max_block
T::BlockWeights::get().max_block
}]
fn remove_member(
origin,
Expand Down Expand Up @@ -829,7 +829,7 @@ impl<T: Trait> Module<T> {
if !Self::term_duration().is_zero() {
if (block_number % Self::term_duration()).is_zero() {
Self::do_phragmen();
return T::block_weights().max_block;
return T::BlockWeights::get().max_block;
}
}
0
Expand Down
22 changes: 13 additions & 9 deletions frame/executive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ mod tests {
traits::{Currency, LockIdentifier, LockableCurrency, WithdrawReasons},
};
use frame_system::{
Call as SystemCall, ChainContext, LastRuntimeUpgradeInfo, Trait as _
Call as SystemCall, ChainContext, LastRuntimeUpgradeInfo,
};
use pallet_transaction_payment::CurrencyAdapter;
use pallet_balances::Call as BalancesCall;
Expand Down Expand Up @@ -719,7 +719,7 @@ mod tests {
}.assimilate_storage(&mut t).unwrap();
let xt = TestXt::new(Call::Balances(BalancesCall::transfer(2, 69)), sign_extra(1, 0, 0));
let weight = xt.get_dispatch_info().weight +
Runtime::block_weights().get(DispatchClass::Normal).base_extrinsic;
<Runtime as frame_system::Trait>::BlockWeights::get().get(DispatchClass::Normal).base_extrinsic;
let fee: Balance
= <Runtime as pallet_transaction_payment::Trait>::WeightToFee::calc(&weight);
let mut t = sp_io::TestExternalities::new(t);
Expand Down Expand Up @@ -822,8 +822,9 @@ mod tests {
let encoded = xt.encode();
let encoded_len = encoded.len() as Weight;
// on_initialize weight + base block execution weight
let base_block_weight = 175 + Runtime::block_weights().base_block;
let limit = Runtime::block_weights().get(DispatchClass::Normal).max_total.unwrap()
let block_weights = <Runtime as frame_system::Trait>::BlockWeights::get();
let base_block_weight = 175 + block_weights.base_block;
let limit = block_weights.get(DispatchClass::Normal).max_total.unwrap()
- base_block_weight;
let num_to_exhaust_block = limit / (encoded_len + 5);
t.execute_with(|| {
Expand Down Expand Up @@ -866,7 +867,7 @@ mod tests {
let mut t = new_test_ext(1);
t.execute_with(|| {
// Block execution weight + on_initialize weight from custom module
let base_block_weight = 175 + Runtime::block_weights().base_block;
let base_block_weight = 175 + <Runtime as frame_system::Trait>::BlockWeights::get().base_block;

Executive::initialize_block(&Header::new(
1,
Expand All @@ -884,8 +885,8 @@ mod tests {
assert!(Executive::apply_extrinsic(x2.clone()).unwrap().is_ok());

// default weight for `TestXt` == encoded length.
let extrinsic_weight = len as Weight +
Runtime::block_weights().get(DispatchClass::Normal).base_extrinsic;
let extrinsic_weight = len as Weight + <Runtime as frame_system::Trait>::BlockWeights
::get().get(DispatchClass::Normal).base_extrinsic;
assert_eq!(
<frame_system::Module<Runtime>>::block_weight().total(),
base_block_weight + 3 * extrinsic_weight,
Expand Down Expand Up @@ -951,8 +952,11 @@ mod tests {
Call::System(SystemCall::remark(vec![1u8])),
sign_extra(1, 0, 0),
);
let weight = xt.get_dispatch_info().weight +
Runtime::block_weights().get(DispatchClass::Normal).base_extrinsic;
let weight = xt.get_dispatch_info().weight + <Runtime as frame_system::Trait>
::BlockWeights
::get()
.get(DispatchClass::Normal)
.base_extrinsic;
let fee: Balance =
<Runtime as pallet_transaction_payment::Trait>::WeightToFee::calc(&weight);
Executive::initialize_block(&Header::new(
Expand Down
2 changes: 1 addition & 1 deletion frame/proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,6 @@ pub mod migration {
deposit,
))
);
T::block_weights().max_block
T::BlockWeights::get().max_block
}
}
26 changes: 13 additions & 13 deletions frame/society/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ decl_module! {
///
/// Total Complexity: O(M + B + C + logM + logB + X)
/// # </weight>
#[weight = T::block_weights().max_block / 10]
#[weight = T::BlockWeights::get().max_block / 10]
pub fn bid(origin, value: BalanceOf<T, I>) -> DispatchResult {
let who = ensure_signed(origin)?;
ensure!(!<SuspendedCandidates<T, I>>::contains_key(&who), Error::<T, I>::Suspended);
Expand Down Expand Up @@ -572,7 +572,7 @@ decl_module! {
///
/// Total Complexity: O(B + X)
/// # </weight>
#[weight = T::block_weights().max_block / 10]
#[weight = T::BlockWeights::get().max_block / 10]
pub fn unbid(origin, pos: u32) -> DispatchResult {
let who = ensure_signed(origin)?;

Expand Down Expand Up @@ -642,7 +642,7 @@ decl_module! {
///
/// Total Complexity: O(M + B + C + logM + logB + X)
/// # </weight>
#[weight = T::block_weights().max_block / 10]
#[weight = T::BlockWeights::get().max_block / 10]
pub fn vouch(origin, who: T::AccountId, value: BalanceOf<T, I>, tip: BalanceOf<T, I>) -> DispatchResult {
let voucher = ensure_signed(origin)?;
// Check user is not suspended.
Expand Down Expand Up @@ -683,7 +683,7 @@ decl_module! {
///
/// Total Complexity: O(B)
/// # </weight>
#[weight = T::block_weights().max_block / 10]
#[weight = T::BlockWeights::get().max_block / 10]
pub fn unvouch(origin, pos: u32) -> DispatchResult {
let voucher = ensure_signed(origin)?;
ensure!(Self::vouching(&voucher) == Some(VouchingStatus::Vouching), Error::<T, I>::NotVouching);
Expand Down Expand Up @@ -721,7 +721,7 @@ decl_module! {
///
/// Total Complexity: O(M + logM + C)
/// # </weight>
#[weight = T::block_weights().max_block / 10]
#[weight = T::BlockWeights::get().max_block / 10]
pub fn vote(origin, candidate: <T::Lookup as StaticLookup>::Source, approve: bool) {
let voter = ensure_signed(origin)?;
let candidate = T::Lookup::lookup(candidate)?;
Expand Down Expand Up @@ -752,7 +752,7 @@ decl_module! {
///
/// Total Complexity: O(M + logM)
/// # </weight>
#[weight = T::block_weights().max_block / 10]
#[weight = T::BlockWeights::get().max_block / 10]
pub fn defender_vote(origin, approve: bool) {
let voter = ensure_signed(origin)?;
let members = <Members<T, I>>::get();
Expand Down Expand Up @@ -784,7 +784,7 @@ decl_module! {
///
/// Total Complexity: O(M + logM + P + X)
/// # </weight>
#[weight = T::block_weights().max_block / 10]
#[weight = T::BlockWeights::get().max_block / 10]
pub fn payout(origin) {
let who = ensure_signed(origin)?;

Expand Down Expand Up @@ -826,7 +826,7 @@ decl_module! {
///
/// Total Complexity: O(1)
/// # </weight>
#[weight = T::block_weights().max_block / 10]
#[weight = T::BlockWeights::get().max_block / 10]
fn found(origin, founder: T::AccountId, max_members: u32, rules: Vec<u8>) {
T::FounderSetOrigin::ensure_origin(origin)?;
ensure!(!<Head<T, I>>::exists(), Error::<T, I>::AlreadyFounded);
Expand All @@ -853,7 +853,7 @@ decl_module! {
///
/// Total Complexity: O(1)
/// # </weight>
#[weight = T::block_weights().max_block / 10]
#[weight = T::BlockWeights::get().max_block / 10]
fn unfound(origin) {
let founder = ensure_signed(origin)?;
ensure!(Founder::<T, I>::get() == Some(founder.clone()), Error::<T, I>::NotFounder);
Expand Down Expand Up @@ -895,7 +895,7 @@ decl_module! {
///
/// Total Complexity: O(M + logM + B)
/// # </weight>
#[weight = T::block_weights().max_block / 10]
#[weight = T::BlockWeights::get().max_block / 10]
fn judge_suspended_member(origin, who: T::AccountId, forgive: bool) {
T::SuspensionJudgementOrigin::ensure_origin(origin)?;
ensure!(<SuspendedMembers<T, I>>::contains_key(&who), Error::<T, I>::NotSuspended);
Expand Down Expand Up @@ -966,7 +966,7 @@ decl_module! {
///
/// Total Complexity: O(M + logM + B + X)
/// # </weight>
#[weight = T::block_weights().max_block / 10]
#[weight = T::BlockWeights::get().max_block / 10]
fn judge_suspended_candidate(origin, who: T::AccountId, judgement: Judgement) {
T::SuspensionJudgementOrigin::ensure_origin(origin)?;
if let Some((value, kind)) = <SuspendedCandidates<T, I>>::get(&who) {
Expand Down Expand Up @@ -1026,7 +1026,7 @@ decl_module! {
///
/// Total Complexity: O(1)
/// # </weight>
#[weight = T::block_weights().max_block / 10]
#[weight = T::BlockWeights::get().max_block / 10]
fn set_max_members(origin, max: u32) {
ensure_root(origin)?;
ensure!(max > 1, Error::<T, I>::MaxMembers);
Expand All @@ -1038,7 +1038,7 @@ decl_module! {
let mut members = vec![];

let mut weight = 0;
let weights = T::block_weights();
let weights = T::BlockWeights::get();

// Run a candidate/membership rotation
if (n % T::RotationPeriod::get()).is_zero() {
Expand Down
7 changes: 5 additions & 2 deletions frame/system/benchmarking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ use sp_std::prelude::*;
use sp_core::{ChangesTrieConfiguration, storage::well_known_keys};
use sp_runtime::traits::Hash;
use frame_benchmarking::{benchmarks, whitelisted_caller};
use frame_support::storage::{self, StorageMap};
use frame_support::{
storage::{self, StorageMap},
traits::Get,
};
use frame_system::{Module as System, Call, RawOrigin, DigestItemOf, AccountInfo};

mod mock;
Expand All @@ -37,7 +40,7 @@ benchmarks! {
_ { }

remark {
let b in 0 .. T::block_weights().max_block as u32;
let b in 0 .. T::BlockWeights::get().max_block as u32;
let remark_message = vec![1; b as usize];
let caller = whitelisted_caller();
}: _(RawOrigin::Signed(caller), remark_message)
Expand Down
24 changes: 14 additions & 10 deletions frame/system/src/extensions/check_weight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,17 @@ mod tests {
use frame_support::{assert_ok, assert_noop};
use frame_support::weights::{Weight, Pays};

fn block_weights() -> crate::limits::BlockWeights {
<Test as crate::Trait>::BlockWeights::get()
}

fn normal_weight_limit() -> Weight {
Test::block_weights().get(DispatchClass::Normal).max_total
.unwrap_or_else(|| Test::block_weights().max_block)
block_weights().get(DispatchClass::Normal).max_total
.unwrap_or_else(|| block_weights().max_block)
}

fn block_weight_limit() -> Weight {
Test::block_weights().max_block
block_weights().max_block
}

fn normal_length_limit() -> u32 {
Expand Down Expand Up @@ -308,7 +312,7 @@ mod tests {
fn normal_extrinsic_limited_by_maximum_extrinsic_weight() {
new_test_ext().execute_with(|| {
let max = DispatchInfo {
weight: Test::block_weights().get(DispatchClass::Normal).max_extrinsic.unwrap() + 1,
weight: block_weights().get(DispatchClass::Normal).max_extrinsic.unwrap() + 1,
class: DispatchClass::Normal,
..Default::default()
};
Expand All @@ -324,7 +328,7 @@ mod tests {
#[test]
fn operational_extrinsic_limited_by_operational_space_limit() {
new_test_ext().execute_with(|| {
let weights = Test::block_weights();
let weights = block_weights();
let operational_limit = weights.get(DispatchClass::Operational).max_total
.unwrap_or_else(|| weights.max_block);
let base_weight = weights.get(DispatchClass::Normal).base_extrinsic;
Expand Down Expand Up @@ -507,7 +511,7 @@ mod tests {
new_test_ext().execute_with(|| {
let normal_limit = normal_weight_limit();
let small = DispatchInfo { weight: 100, ..Default::default() };
let base_extrinsic = Test::block_weights().get(DispatchClass::Normal).base_extrinsic;
let base_extrinsic = block_weights().get(DispatchClass::Normal).base_extrinsic;
let medium = DispatchInfo {
weight: normal_limit - base_extrinsic,
..Default::default()
Expand Down Expand Up @@ -542,7 +546,7 @@ mod tests {
pays_fee: Default::default(),
};
let len = 0_usize;
let base_extrinsic = Test::block_weights().get(DispatchClass::Normal).base_extrinsic;
let base_extrinsic = block_weights().get(DispatchClass::Normal).base_extrinsic;

// We allow 75% for normal transaction, so we put 25% - extrinsic base weight
BlockWeight::mutate(|current_weight| {
Expand Down Expand Up @@ -582,7 +586,7 @@ mod tests {
let pre = CheckWeight::<Test>(PhantomData).pre_dispatch(&1, CALL, &info, len).unwrap();
assert_eq!(
BlockWeight::get().total(),
info.weight + 128 + Test::block_weights().get(DispatchClass::Normal).base_extrinsic,
info.weight + 128 + block_weights().get(DispatchClass::Normal).base_extrinsic,
);

assert!(
Expand All @@ -591,15 +595,15 @@ mod tests {
);
assert_eq!(
BlockWeight::get().total(),
info.weight + 128 + Test::block_weights().get(DispatchClass::Normal).base_extrinsic,
info.weight + 128 + block_weights().get(DispatchClass::Normal).base_extrinsic,
);
})
}

#[test]
fn zero_weight_extrinsic_still_has_base_weight() {
new_test_ext().execute_with(|| {
let weights = Test::block_weights();
let weights = block_weights();
let free = DispatchInfo { weight: 0, ..Default::default() };
let len = 0_usize;

Expand Down
15 changes: 5 additions & 10 deletions frame/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,6 @@ pub trait Trait: 'static + Eq + Clone {
type OnKilledAccount: OnKilledAccount<Self::AccountId>;

type SystemWeightInfo: WeightInfo;

/// Return block weights object.
fn block_weights() -> limits::BlockWeights {
Self::BlockWeights::get()
}
}

pub type DigestOf<T> = generic::Digest<<T as Trait>::Hash>;
Expand Down Expand Up @@ -521,22 +516,22 @@ decl_module! {
Some(AccountInfo { nonce, refcount: rc as RefCount, data })
);
UpgradedToU32RefCount::put(true);
T::block_weights().max_block
T::BlockWeights::get().max_block
} else {
0
}
}

fn integrity_test() {
T::block_weights()
T::BlockWeights::get()
.validate()
.expect("The weights are invalid.");
}

/// A dispatch that will fill the block weight up to the given ratio.
// TODO: This should only be available for testing, rather than in general usage, but
// that's not possible at present (since it's within the decl_module macro).
#[weight = *_ratio * T::block_weights().max_block]
#[weight = *_ratio * T::BlockWeights::get().max_block]
fn fill_block(origin, _ratio: Perbill) {
ensure_root(origin)?;
}
Expand Down Expand Up @@ -577,7 +572,7 @@ decl_module! {
/// The weight of this function is dependent on the runtime, but generally this is very expensive.
/// We will treat this as a full block.
/// # </weight>
#[weight = (T::block_weights().max_block, DispatchClass::Operational)]
#[weight = (T::BlockWeights::get().max_block, DispatchClass::Operational)]
pub fn set_code(origin, code: Vec<u8>) {
ensure_root(origin)?;
Self::can_set_code(&code)?;
Expand All @@ -594,7 +589,7 @@ decl_module! {
/// - 1 event.
/// The weight of this function is dependent on the runtime. We will treat this as a full block.
/// # </weight>
#[weight = (T::block_weights().max_block, DispatchClass::Operational)]
#[weight = (T::BlockWeights::get().max_block, DispatchClass::Operational)]
pub fn set_code_without_checks(origin, code: Vec<u8>) {
ensure_root(origin)?;
storage::unhashed::put_raw(well_known_keys::CODE, &code);
Expand Down
2 changes: 1 addition & 1 deletion frame/system/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
let mut ext: sp_io::TestExternalities = GenesisConfig::default().build_storage::<Test>().unwrap().into();
// Add to each test the initial weight of a block
ext.execute_with(|| System::register_extra_weight_unchecked(
Test::block_weights().base_block,
<Test as crate::Trait>::BlockWeights::get().base_block,
DispatchClass::Mandatory
));
ext
Expand Down
Loading