mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 11:41:02 +00:00
Update for using Mandatory inherents (#967)
* Update for using Mandatory inherents. * use
This commit is contained in:
@@ -131,7 +131,7 @@ decl_module! {
|
|||||||
type Error = Error<T>;
|
type Error = Error<T>;
|
||||||
|
|
||||||
/// Provide candidate receipts for parachains, in ascending order by id.
|
/// Provide candidate receipts for parachains, in ascending order by id.
|
||||||
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
|
#[weight = frame_support::weights::SimpleDispatchInfo::FixedMandatory(10_000)]
|
||||||
fn more_attestations(origin, _more: MoreAttestations) -> DispatchResult {
|
fn more_attestations(origin, _more: MoreAttestations) -> DispatchResult {
|
||||||
ensure_none(origin)?;
|
ensure_none(origin)?;
|
||||||
ensure!(!DidUpdate::exists(), Error::<T>::TooManyAttestations);
|
ensure!(!DidUpdate::exists(), Error::<T>::TooManyAttestations);
|
||||||
|
|||||||
@@ -399,7 +399,7 @@ decl_module! {
|
|||||||
type Error = Error<T>;
|
type Error = Error<T>;
|
||||||
|
|
||||||
/// Provide candidate receipts for parachains, in ascending order by id.
|
/// Provide candidate receipts for parachains, in ascending order by id.
|
||||||
#[weight = SimpleDispatchInfo::FixedNormal(1_000_000)]
|
#[weight = SimpleDispatchInfo::FixedMandatory(1_000_000)]
|
||||||
pub fn set_heads(origin, heads: Vec<AttestedCandidate>) -> DispatchResult {
|
pub fn set_heads(origin, heads: Vec<AttestedCandidate>) -> DispatchResult {
|
||||||
ensure_none(origin)?;
|
ensure_none(origin)?;
|
||||||
ensure!(!<DidUpdate>::exists(), Error::<T>::TooManyHeadUpdates);
|
ensure!(!<DidUpdate>::exists(), Error::<T>::TooManyHeadUpdates);
|
||||||
|
|||||||
@@ -277,7 +277,16 @@ impl<Client, TxPool, Backend> CreateProposalData<Client, TxPool, Backend> where
|
|||||||
{
|
{
|
||||||
let inherents = runtime_api.inherent_extrinsics(&self.parent_id, inherent_data)?;
|
let inherents = runtime_api.inherent_extrinsics(&self.parent_id, inherent_data)?;
|
||||||
for inherent in inherents {
|
for inherent in inherents {
|
||||||
block_builder.push(inherent)?;
|
match block_builder.push(inherent) {
|
||||||
|
Err(sp_blockchain::Error::ApplyExtrinsicFailed(sp_blockchain::ApplyExtrinsicFailed::Validity(e)))
|
||||||
|
if e.exhausted_resources() => {
|
||||||
|
warn!("⚠️ Dropping non-mandatory inherent from overweight block.");
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
warn!("❗️ Inherent extrinsic returned unexpected error: {}. Dropping.", e);
|
||||||
|
}
|
||||||
|
Ok(_) => {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut unqueue_invalid = Vec::new();
|
let mut unqueue_invalid = Vec::new();
|
||||||
|
|||||||
Reference in New Issue
Block a user