Skip to content

Commit

Permalink
fix merge + fix some import + fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
gui1117 committed Nov 15, 2024
1 parent 48a2450 commit 1a9aeee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions cumulus/pallets/weight-reclaim/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ use derivative::Derivative;
use frame_support::{
dispatch::{DispatchInfo, PostDispatchInfo},
pallet_prelude::Weight,
traits::Defensive,
};
use scale_info::TypeInfo;
use sp_runtime::{
traits::{DispatchInfoOf, Dispatchable, PostDispatchInfoOf, TransactionExtension},
transaction_validity::{TransactionValidityError, ValidTransaction},
transaction_validity::{TransactionSource, TransactionValidityError, ValidTransaction},
DispatchResult,
};

Expand Down Expand Up @@ -147,11 +148,12 @@ where
len: usize,
self_implicit: Self::Implicit,
inherited_implication: &impl Encode,
source: TransactionSource,
) -> Result<(ValidTransaction, Self::Val, T::RuntimeOrigin), TransactionValidityError> {
let proof_size = get_proof_size();

self.0
.validate(origin, call, info, len, self_implicit, inherited_implication)
.validate(origin, call, info, len, self_implicit, inherited_implication, source)
.map(|(validity, val, origin)| (validity, (proof_size, val), origin))
}

Expand Down Expand Up @@ -199,7 +201,8 @@ where
};

// The consumed proof size as measured by the host.
let measured_proof_size = proof_size_after_dispatch.saturating_sub(proof_size_before_dispatch);
let measured_proof_size =
proof_size_after_dispatch.saturating_sub(proof_size_before_dispatch);

// The consumed weight as benchmarked. Calculated from post info and info.
// NOTE: `calc_actual_weight` will take the minimum of `post_info` and `info` weights.
Expand Down
3 changes: 2 additions & 1 deletion substrate/frame/system/src/extensions/weight_reclaim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use sp_runtime::{
traits::{
DispatchInfoOf, Dispatchable, PostDispatchInfoOf, TransactionExtension, ValidateResult,
},
transaction_validity::{TransactionValidityError, ValidTransaction},
transaction_validity::{TransactionSource, TransactionValidityError, ValidTransaction},
DispatchResult,
};
use sp_weights::Weight;
Expand Down Expand Up @@ -67,6 +67,7 @@ where
_len: usize,
_self_implicit: Self::Implicit,
_inherited_implication: &impl Encode,
_source: TransactionSource,
) -> ValidateResult<Self::Val, T::RuntimeCall> {
Ok((ValidTransaction::default(), (), origin))
}
Expand Down

0 comments on commit 1a9aeee

Please sign in to comment.