mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 11:41:02 +00:00
* Change branch. * Update runtime. * Revert "Change branch." This reverts commit 841c59f3398136c27cc235a29d7d459e8a4c8ce0. * Update substrate. * Fix tests. * Fix compilation. * Fix frame system imports. * Fix usages of system * Fix stuff. * Fix compilation. * Fixes. * Fix block_weight usage. * Bump substrate.
This commit is contained in:
@@ -34,9 +34,8 @@ use primitives::v1::{
|
||||
use runtime_common::{
|
||||
claims, SlowAdjustingFeeUpdate, CurrencyToVote,
|
||||
impls::DealWithFees,
|
||||
BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
||||
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight,
|
||||
MaximumExtrinsicWeight, ParachainSessionKeyPlaceholder,
|
||||
BlockHashCount, RocksDbWeight, BlockWeights, BlockLength, OffchainSolutionWeightLimit,
|
||||
ParachainSessionKeyPlaceholder,
|
||||
};
|
||||
use sp_runtime::{
|
||||
create_runtime_str, generic, impl_opaque_keys, ModuleId,
|
||||
@@ -129,6 +128,8 @@ parameter_types! {
|
||||
|
||||
impl frame_system::Config for Runtime {
|
||||
type BaseCallFilter = BaseFilter;
|
||||
type BlockWeights = BlockWeights;
|
||||
type BlockLength = BlockLength;
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
type Index = Nonce;
|
||||
@@ -140,13 +141,7 @@ impl frame_system::Config for Runtime {
|
||||
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
type Event = Event;
|
||||
type BlockHashCount = BlockHashCount;
|
||||
type MaximumBlockWeight = MaximumBlockWeight;
|
||||
type DbWeight = RocksDbWeight;
|
||||
type BlockExecutionWeight = BlockExecutionWeight;
|
||||
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
||||
type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
|
||||
type MaximumBlockLength = MaximumBlockLength;
|
||||
type AvailableBlockRatio = AvailableBlockRatio;
|
||||
type Version = Version;
|
||||
type PalletInfo = PalletInfo;
|
||||
type AccountData = pallet_balances::AccountData<Balance>;
|
||||
@@ -156,6 +151,8 @@ impl frame_system::Config for Runtime {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) *
|
||||
BlockWeights::get().max_block;
|
||||
pub const MaxScheduledPerBlock: u32 = 50;
|
||||
}
|
||||
|
||||
@@ -164,7 +161,7 @@ impl pallet_scheduler::Config for Runtime {
|
||||
type Origin = Origin;
|
||||
type PalletsOrigin = OriginCaller;
|
||||
type Call = Call;
|
||||
type MaximumWeight = MaximumBlockWeight;
|
||||
type MaximumWeight = MaximumSchedulerWeight;
|
||||
type ScheduleOrigin = EnsureRoot<AccountId>;
|
||||
type MaxScheduledPerBlock = MaxScheduledPerBlock;
|
||||
type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>;
|
||||
@@ -326,9 +323,6 @@ parameter_types! {
|
||||
pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 4;
|
||||
pub const MaxIterations: u32 = 10;
|
||||
pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000);
|
||||
pub OffchainSolutionWeightLimit: Weight = MaximumExtrinsicWeight::get()
|
||||
.saturating_sub(BlockExecutionWeight::get())
|
||||
.saturating_sub(ExtrinsicBaseWeight::get());
|
||||
}
|
||||
|
||||
type SlashCancelOrigin = EnsureOneOf<
|
||||
@@ -557,7 +551,7 @@ impl pallet_treasury::Config for Runtime {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get();
|
||||
pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * BlockWeights::get().max_block;
|
||||
}
|
||||
|
||||
impl pallet_offences::Config for Runtime {
|
||||
@@ -1107,7 +1101,7 @@ impl frame_support::traits::OnRuntimeUpgrade for FixCouncilHistoricalVotes {
|
||||
};
|
||||
});
|
||||
frame_support::debug::info!("Migration to fix voters happened. Accounts with inaccurate reserved amount: {}", failure);
|
||||
<Runtime as frame_system::Config>::MaximumBlockWeight::get()
|
||||
<Runtime as frame_system::Config>::BlockWeights::get().max_block
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1534,11 +1528,12 @@ mod test_fees {
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn block_cost() {
|
||||
let raw_fee = WeightToFee::calc(&MaximumBlockWeight::get());
|
||||
let max_block_weight = BlockWeights::get().max_block;
|
||||
let raw_fee = WeightToFee::calc(&max_block_weight);
|
||||
|
||||
println!(
|
||||
"Full Block weight == {} // WeightToFee(full_block) == {} plank",
|
||||
MaximumBlockWeight::get(),
|
||||
max_block_weight,
|
||||
raw_fee.separated_string(),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user