Fix use of weight limit errors (#4358)

This commit is contained in:
Gavin Wood
2021-11-24 13:26:33 +01:00
committed by GitHub
parent e08b0fb506
commit c699ca9c7b
5 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -344,7 +344,7 @@ impl<Config: config::Config> XcmExecutor<Config> {
let dispatch_origin = Config::OriginConverter::convert_origin(origin, origin_type)
.map_err(|_| XcmError::BadOrigin)?;
let weight = message_call.get_dispatch_info().weight;
ensure!(weight <= require_weight_at_most, XcmError::TooMuchWeightRequired);
ensure!(weight <= require_weight_at_most, XcmError::MaxWeightInvalid);
let actual_weight = match message_call.dispatch(dispatch_origin) {
Ok(post_info) => post_info.actual_weight,
Err(error_and_info) => {