fn generate_impl_call(
	signature: &MethodSig,
	runtime: &Type,
	input: &Ident,
	impl_trait: &Path
) -> Result<TokenStream> {
	let params = extract_parameter_names_types_and_borrows(&signature.decl)?;

	let c = generate_crate_access(HIDDEN_INCLUDES_ID);
	let c_iter = iter::repeat(&c);
	let fn_name = &signature.ident;
	let fn_name_str = iter::repeat(fn_name.to_string());
	let input = iter::repeat(input);
	let pnames = params.iter().map(|v| &v.0);
	let pnames2 = params.iter().map(|v| &v.0);
	let ptypes = params.iter().map(|v| &v.1);
	let pborrow = params.iter().map(|v| &v.2);

	Ok(
		quote!(
			#(
				let #pnames : #ptypes = match #c_iter::runtime_api::Decode::decode(&mut #input) {
					Some(input) => input,
					None => panic!("Bad input data provided to {}", #fn_name_str),
				};
			)*

			#[allow(deprecated)]
			let output = <#runtime as #impl_trait>::#fn_name(#( #pborrow #pnames2 ),*);
			#c::runtime_api::Encode::encode(&output)
		)
	)
}
/// Generates the call to the implementation of the requested function.
/// The generated code includes decoding of the input arguments and encoding of the output.
Generates the call to the implementation of the requested function.
The generated code includes decoding of the input arguments and encoding of the output.
Generates the call to the implementation of the requested function . The generated code includes decoding of the input arguments and encoding of the output .
fn generate_impl_call(
	signature: &MethodSig,
	runtime: &Type,
	input: &Ident,
	impl_trait: &Path
) -> Result<TokenStream> {
	let params = extract_parameter_names_types_and_borrows(&signature.decl)?;
	let c = generate_crate_access(HIDDEN_INCLUDES_ID);
	let c_iter = iter::repeat(&c);
	let fn_name = &signature.ident;
	let fn_name_str = iter::repeat(fn_name.to_string());
	let input = iter::repeat(input);
	let pnames = params.iter().map(|v| &v.0);
	let pnames2 = params.iter().map(|v| &v.0);
	let ptypes = params.iter().map(|v| &v.1);
	let pborrow = params.iter().map(|v| &v.2);
	Ok(
		quote!(
			#(
				let #pnames : #ptypes = match #c_iter::runtime_api::Decode::decode(&mut #input) {
					Some(input) => input,
					None => panic!("Bad input data provided to {}", #fn_name_str),
				};
			)*
			#[allow(deprecated)]
			let output = <#runtime as #impl_trait>::#fn_name(#( #pborrow #pnames2 ),*);
			#c::runtime_api::Encode::encode(&output)
		)
	)
}
fn generate_impl_call ( signature : & MethodSig , runtime : & Type , input : & Ident , impl_trait : & Path ) -> Result < TokenStream > { let params = extract_parameter_names_types_and_borrows ( & signature . decl ) ? ; let c = generate_crate_access ( HIDDEN_INCLUDES_ID ) ; let c_iter = iter :: repeat ( & c ) ; let fn_name = & signature . ident ; let fn_name_str = iter :: repeat ( fn_name . to_string ( ) ) ; let input = iter :: repeat ( input ) ; let pnames = params . iter ( ) . map ( | v | & v . 0 ) ; let pnames2 = params . iter ( ) . map ( | v | & v . 0 ) ; let ptypes = params . iter ( ) . map ( | v | & v . 1 ) ; let pborrow = params . iter ( ) . map ( | v | & v . 2 ) ; Ok ( quote ! ( ( let pnames ptypes match c_iter runtime_api Decode decode ( mut input ) { Some ( input ) input None panic ( " " fn_name_str ) } ) [ allow ( deprecated ) ] let output runtime as impl_trait fn_name ( ( pborrow pnames2 ) ) c runtime_api Encode encode ( output ) ) ) }
Generates the call to the implementation of the requested function.
Generates the call to the implementation of the requested function .
signature
&MethodSig
runtime
&Type
input
&Ident
impl_trait
&Path
signature
&MethodSig
runtime
&Type
input
&Ident
impl_trait
&Path