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
+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)
}
}