mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 19:37:56 +00:00
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:
@@ -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));
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user