use DecodeLimit when decoding incoming calls (#1344)

This commit is contained in:
Svyatoslav Nikolsky
2022-03-09 10:14:01 +03:00
committed by Bastian Köcher
parent 9b4d44bcfa
commit 814f23584c
2 changed files with 8 additions and 2 deletions
+2
View File
@@ -29,6 +29,7 @@ frame-support = { git = "https://github.com/paritytech/substrate", branch = "mas
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
@@ -50,6 +51,7 @@ std = [
"pallet-bridge-messages/std",
"pallet-transaction-payment/std",
"scale-info/std",
"sp-api/std",
"sp-core/std",
"sp-runtime/std",
"sp-state-machine/std",
+6 -2
View File
@@ -30,7 +30,7 @@ use bp_runtime::{
messages::{DispatchFeePayment, MessageDispatchResult},
ChainId, Size, StorageProofChecker,
};
use codec::{Decode, Encode};
use codec::{Decode, DecodeLimit, Encode};
use frame_support::{
traits::{Currency, ExistenceRequirement},
weights::{Weight, WeightToFeePolynomial},
@@ -521,7 +521,11 @@ pub mod target {
for Result<DecodedCall, ()>
{
fn from(encoded_call: FromBridgedChainEncodedMessageCall<DecodedCall>) -> Self {
DecodedCall::decode(&mut &encoded_call.encoded_call[..]).map_err(drop)
DecodedCall::decode_with_depth_limit(
sp_api::MAX_EXTRINSIC_DEPTH,
&mut &encoded_call.encoded_call[..],
)
.map_err(drop)
}
}