mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-08 06:38:01 +00:00
Refund weight in system::fillBlock (#11754)
* fix * pushed * node: fix fee multiplier test Co-authored-by: André Silva <andrerfosilva@gmail.com>
This commit is contained in:
@@ -197,6 +197,7 @@ impl<MaxNormal: Get<u32>, MaxOverflow: Get<u32>> ConsumerLimits for (MaxNormal,
|
||||
pub mod pallet {
|
||||
use crate::{self as frame_system, pallet_prelude::*, *};
|
||||
use frame_support::pallet_prelude::*;
|
||||
use sp_runtime::DispatchErrorWithPostInfo;
|
||||
|
||||
/// System configuration trait. Implemented by runtime.
|
||||
#[pallet::config]
|
||||
@@ -371,8 +372,16 @@ pub mod pallet {
|
||||
// that's not possible at present (since it's within the pallet macro).
|
||||
#[pallet::weight(*_ratio * T::BlockWeights::get().max_block)]
|
||||
pub fn fill_block(origin: OriginFor<T>, _ratio: Perbill) -> DispatchResultWithPostInfo {
|
||||
ensure_root(origin)?;
|
||||
Ok(().into())
|
||||
match ensure_root(origin) {
|
||||
Ok(_) => Ok(().into()),
|
||||
Err(_) => {
|
||||
// roughly same as a 4 byte remark since perbill is u32.
|
||||
Err(DispatchErrorWithPostInfo {
|
||||
post_info: Some(T::SystemWeightInfo::remark(4u32)).into(),
|
||||
error: DispatchError::BadOrigin,
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/// Make some on-chain remark.
|
||||
|
||||
Reference in New Issue
Block a user