mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 12:17:58 +00:00
Validate encoding of extrinsics passed to runtime (#6442)
* Validate encoding of extrinsics passed to runtime * Bump codec version explicitly
This commit is contained in:
@@ -191,7 +191,8 @@ fn generate_native_call_generators(decl: &ItemTrait) -> Result<TokenStream> {
|
||||
input: &I, error_desc: &'static str,
|
||||
) -> std::result::Result<R, String>
|
||||
{
|
||||
<R as #crate_::Decode>::decode(
|
||||
<R as #crate_::DecodeLimit>::decode_with_depth_limit(
|
||||
#crate_::MAX_EXTRINSIC_DEPTH,
|
||||
&mut &#crate_::Encode::encode(input)[..],
|
||||
).map_err(|e| format!("{} {}", error_desc, e.what()))
|
||||
}
|
||||
|
||||
@@ -83,7 +83,10 @@ fn generate_impl_call(
|
||||
Ok(
|
||||
quote!(
|
||||
#(
|
||||
let #pnames : #ptypes = match #c_iter::Decode::decode(&mut #input) {
|
||||
let #pnames : #ptypes = match #c_iter::DecodeLimit::decode_all_with_depth_limit(
|
||||
#c_iter::MAX_EXTRINSIC_DEPTH,
|
||||
&mut #input
|
||||
) {
|
||||
Ok(input) => input,
|
||||
Err(e) => panic!("Bad input data provided to {}: {}", #fn_name_str, e.what()),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user