diff --git a/contracts/feature-tests/composability/builtin-func-features/src/builtin_func_features.rs b/contracts/feature-tests/composability/builtin-func-features/src/builtin_func_features.rs index 81df199e68..dd4183bb94 100644 --- a/contracts/feature-tests/composability/builtin-func-features/src/builtin_func_features.rs +++ b/contracts/feature-tests/composability/builtin-func-features/src/builtin_func_features.rs @@ -7,25 +7,26 @@ multiversx_sc::imports!(); /// Test contract for investigating async calls. #[multiversx_sc::contract] pub trait BuiltinFuncFeatures { - #[proxy] - fn builtin_func_proxy(&self, to: ManagedAddress) -> builtin_func_proxy::Proxy; - #[init] fn init(&self) {} #[endpoint] fn call_set_user_name(&self, address: ManagedAddress, name: ManagedBuffer) { - self.builtin_func_proxy(address) - .set_user_name(&name) + self.tx() + .to(&address) + .typed(builtin_func_proxy::UserBuiltinProxy) + .set_user_name(name) .async_call() .call_and_exit() } #[endpoint] fn call_delete_user_name(&self, address: ManagedAddress) { - self.builtin_func_proxy(address) + self.tx() + .to(&address) + .typed(builtin_func_proxy::UserBuiltinProxy) .delete_user_name() .async_call() - .call_and_exit(); + .call_and_exit() } } diff --git a/contracts/feature-tests/composability/builtin-func-features/src/builtin_func_proxy.rs b/contracts/feature-tests/composability/builtin-func-features/src/builtin_func_proxy.rs index 5499deee5e..8d7d106f66 100644 --- a/contracts/feature-tests/composability/builtin-func-features/src/builtin_func_proxy.rs +++ b/contracts/feature-tests/composability/builtin-func-features/src/builtin_func_proxy.rs @@ -1,10 +1,68 @@ -multiversx_sc::imports!(); +// Code generated by the multiversx-sc proxy generator. DO NOT EDIT. -#[multiversx_sc::derive::proxy] -pub trait UserBuiltin { - #[endpoint(SetUserName)] - fn set_user_name(&self, name: &ManagedBuffer); +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// - #[endpoint(DeleteUserName)] - fn delete_user_name(&self); +#![allow(dead_code)] +#![allow(clippy::all)] + +use multiversx_sc::proxy_imports::*; + +pub struct UserBuiltinProxy; + +impl TxProxyTrait for UserBuiltinProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = UserBuiltinProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + UserBuiltinProxyMethods { wrapped_tx: tx } + } +} + +pub struct UserBuiltinProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl UserBuiltinProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn set_user_name< + Arg0: CodecInto>, + >( + self, + name: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call() + .function_name("SetUserName") + .argument(&name) + .original_result() + } + + pub fn delete_user_name( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call() + .function_name("DeleteUserName") + .original_result() + } }