mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 19:01:08 +00:00
use DecodeLimit when decoding incoming calls (#1344)
This commit is contained in:
committed by
Bastian Köcher
parent
9b4d44bcfa
commit
814f23584c
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user