diff --git a/framework/base/src/types/interaction/callback_closure.rs b/framework/base/src/types/interaction/callback_closure.rs index 6b2b73feee..b7ea4264a8 100644 --- a/framework/base/src/types/interaction/callback_closure.rs +++ b/framework/base/src/types/interaction/callback_closure.rs @@ -9,10 +9,9 @@ use crate::{ }, contract_base::{BlockchainWrapper, ExitCodecErrorHandler, ManagedSerializer}, err_msg, - io::ManagedResultArgLoader, storage::StorageKey, storage_clear, storage_get, storage_set, - types::{ManagedBuffer, ManagedType}, + types::{ManagedBuffer, ManagedType, ManagedVecRefIterator}, }; use super::ManagedArgBuffer; @@ -125,8 +124,8 @@ impl CallbackClosureForDeser { CallbackClosureMatcher::new(&self.callback_name) } - pub fn into_arg_loader(self) -> ManagedResultArgLoader { - ManagedResultArgLoader::new(self.closure_args.data) + pub fn arg_iter(&self) -> ManagedVecRefIterator<'_, M, ManagedBuffer> { + self.closure_args.iter_buffers() } } diff --git a/framework/derive/src/generate/method_call_gen_arg.rs b/framework/derive/src/generate/method_call_gen_arg.rs index 20550ca024..8c9b7a0aee 100644 --- a/framework/derive/src/generate/method_call_gen_arg.rs +++ b/framework/derive/src/generate/method_call_gen_arg.rs @@ -88,7 +88,7 @@ pub fn load_legacy_cb_closure_args_snippet(m: &Method) -> proc_macro2::TokenStre }); quote! { let #closure_var_names = multiversx_sc::io::load_multi_args_custom_loader::( - ___cb_closure___.into_arg_loader(), + ___cb_closure___.arg_iter(), #closure_var_names_str, ); }