mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 14:41:11 +00:00
Relocate weight to paint + decouple from extensions (#4124)
* Fisr migrated version of weight to paint * Bump * Minor nits * Some review fixes. * Line width * Revert spec bump * Fix build * Update lock file * Update palette/executive/src/lib.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Update palette/membership/src/lib.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -34,7 +34,11 @@ mod tests {
|
||||
use super::Executor;
|
||||
use {balances, contracts, indices, system, timestamp};
|
||||
use codec::{Encode, Decode, Joiner};
|
||||
use runtime_support::{Hashable, StorageValue, StorageMap, traits::Currency};
|
||||
use runtime_support::{
|
||||
Hashable, StorageValue, StorageMap,
|
||||
traits::Currency,
|
||||
weights::GetDispatchInfo,
|
||||
};
|
||||
use state_machine::TestExternalities as CoreTestExternalities;
|
||||
use primitives::{
|
||||
Blake2Hasher, NeverNativeValue, NativeOrEncoded, map,
|
||||
@@ -43,7 +47,7 @@ mod tests {
|
||||
use sr_primitives::{
|
||||
Fixed64,
|
||||
traits::{Header as HeaderT, Hash as HashT, Convert}, ApplyResult,
|
||||
transaction_validity::InvalidTransaction, weights::GetDispatchInfo,
|
||||
transaction_validity::InvalidTransaction,
|
||||
};
|
||||
use contracts::ContractAddressFor;
|
||||
use substrate_executor::{NativeExecutor, WasmExecutionMethod};
|
||||
|
||||
@@ -17,10 +17,9 @@
|
||||
//! Some configurable implementations as associated type for the substrate runtime.
|
||||
|
||||
use node_primitives::Balance;
|
||||
use sr_primitives::weights::Weight;
|
||||
use sr_primitives::traits::{Convert, Saturating};
|
||||
use sr_primitives::{Fixed64, Perbill};
|
||||
use support::traits::{OnUnbalanced, Currency, Get};
|
||||
use support::{traits::{OnUnbalanced, Currency, Get}, weights::Weight};
|
||||
use crate::{Balances, System, Authorship, MaximumBlockWeight, NegativeImbalance};
|
||||
|
||||
pub struct Author;
|
||||
@@ -116,10 +115,10 @@ impl<T: Get<Perbill>> Convert<Fixed64, Fixed64> for TargetedFeeAdjustment<T> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use sr_primitives::weights::Weight;
|
||||
use sr_primitives::assert_eq_error_rate;
|
||||
use crate::{MaximumBlockWeight, AvailableBlockRatio, Runtime};
|
||||
use crate::{constants::currency::*, TransactionPayment, TargetBlockFullness};
|
||||
use support::weights::Weight;
|
||||
|
||||
fn max() -> Weight {
|
||||
MaximumBlockWeight::get()
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
|
||||
use rstd::prelude::*;
|
||||
use support::{
|
||||
construct_runtime, parameter_types, traits::{SplitTwoWays, Currency, Randomness}
|
||||
construct_runtime, parameter_types,
|
||||
weights::Weight,
|
||||
traits::{SplitTwoWays, Currency, Randomness},
|
||||
};
|
||||
use primitives::u32_trait::{_1, _2, _3, _4};
|
||||
use node_primitives::{AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, Moment, Signature};
|
||||
@@ -30,7 +32,6 @@ use sr_api::impl_runtime_apis;
|
||||
use sr_primitives::{Permill, Perbill, ApplyResult, impl_opaque_keys, generic, create_runtime_str};
|
||||
use sr_primitives::curve::PiecewiseLinear;
|
||||
use sr_primitives::transaction_validity::TransactionValidity;
|
||||
use sr_primitives::weights::Weight;
|
||||
use sr_primitives::traits::{
|
||||
self, BlakeTwo256, Block as BlockT, NumberFor, StaticLookup, SaturatedConversion,
|
||||
OpaqueKeys,
|
||||
@@ -732,7 +733,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn block_hooks_weight_should_not_exceed_limits() {
|
||||
use sr_primitives::weights::WeighBlock;
|
||||
use support::weights::WeighBlock;
|
||||
let check_for_block = |b| {
|
||||
let block_hooks_weight =
|
||||
<AllModules as WeighBlock<BlockNumber>>::on_initialize(b) +
|
||||
|
||||
Reference in New Issue
Block a user