Companion for Weight v1.5 (#1581)

* cargo test -p cumulus-primitives-utility

* cargo test -p cumulus-pallet-xcmp-queue

* cargo test -p cumulus-pallet-xcm

* cargo test -p cumulus-pallet-dmp-queue

* cargo test -p pallet-template

* cargo test -p cumulus-test-runtime

* fix weights

* fix more weights

* cargo test -p parachains-common

* cargo test -p parachain-template-runtime

* fix weights import

* cargo test -p collectives-polkadot-runtime

* cargo test -p contracts-rococo-runtime

* more

* unused

* fixes

* Update benchmarking.rs

* Update lib.rs

* Update lib.rs

* fix

* fix bug in conversion

* update lockfile for {"polkadot", "substrate"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Shawn Tabrizi
2022-08-31 13:24:42 +01:00
committed by GitHub
parent 1ab196df49
commit 3fb9c8a7be
118 changed files with 2005 additions and 1885 deletions
+6 -6
View File
@@ -111,7 +111,7 @@ impl<T: Config> DmpMessageHandler for UnlimitedDmpExecution<T> {
iter: impl Iterator<Item = (RelayBlockNumber, Vec<u8>)>,
limit: Weight,
) -> Weight {
let mut used = 0;
let mut used = Weight::new();
for (_sent_at, data) in iter {
let id = sp_io::hashing::twox_64(&data[..]);
let msg = VersionedXcm::<T::Call>::decode_all_with_depth_limit(
@@ -123,8 +123,8 @@ impl<T: Config> DmpMessageHandler for UnlimitedDmpExecution<T> {
Err(_) => Pallet::<T>::deposit_event(Event::InvalidFormat(id)),
Ok(Err(())) => Pallet::<T>::deposit_event(Event::UnsupportedVersion(id)),
Ok(Ok(x)) => {
let outcome = T::XcmExecutor::execute_xcm(Parent, x, limit);
used += outcome.weight_used();
let outcome = T::XcmExecutor::execute_xcm(Parent, x, limit.ref_time());
used += Weight::from_ref_time(outcome.weight_used());
Pallet::<T>::deposit_event(Event::ExecutedDownward(id, outcome));
},
}
@@ -144,7 +144,7 @@ impl<T: Config> DmpMessageHandler for LimitAndDropDmpExecution<T> {
iter: impl Iterator<Item = (RelayBlockNumber, Vec<u8>)>,
limit: Weight,
) -> Weight {
let mut used = 0;
let mut used = Weight::new();
for (_sent_at, data) in iter {
let id = sp_io::hashing::twox_64(&data[..]);
let msg = VersionedXcm::<T::Call>::decode_all_with_depth_limit(
@@ -157,8 +157,8 @@ impl<T: Config> DmpMessageHandler for LimitAndDropDmpExecution<T> {
Ok(Err(())) => Pallet::<T>::deposit_event(Event::UnsupportedVersion(id)),
Ok(Ok(x)) => {
let weight_limit = limit.saturating_sub(used);
let outcome = T::XcmExecutor::execute_xcm(Parent, x, weight_limit);
used += outcome.weight_used();
let outcome = T::XcmExecutor::execute_xcm(Parent, x, weight_limit.ref_time());
used += Weight::from_ref_time(outcome.weight_used());
Pallet::<T>::deposit_event(Event::ExecutedDownward(id, outcome));
},
}