diff --git a/framework/derive/src/generate/snippets.rs b/framework/derive/src/generate/snippets.rs
index 91fc8a863f..64c590ad5f 100644
--- a/framework/derive/src/generate/snippets.rs
+++ b/framework/derive/src/generate/snippets.rs
@@ -1,11 +1,8 @@
pub fn contract_object_def() -> proc_macro2::TokenStream {
quote! {
- pub struct ContractObj
- where
- A: multiversx_sc::api::VMApi,
- {
- _phantom: core::marker::PhantomData,
- }
+ pub struct ContractObj(multiversx_sc::contract_base::UniversalContractObj)
+ where
+ A: multiversx_sc::api::VMApi;
}
}
@@ -26,9 +23,7 @@ pub fn new_contract_object_fn() -> proc_macro2::TokenStream {
where
A: multiversx_sc::api::VMApi,
{
- ContractObj {
- _phantom: core::marker::PhantomData,
- }
+ ContractObj::(multiversx_sc::contract_base::UniversalContractObj::::new())
}
pub struct ContractBuilder;
@@ -36,10 +31,9 @@ pub fn new_contract_object_fn() -> proc_macro2::TokenStream {
impl multiversx_sc::contract_base::CallableContractBuilder for self::ContractBuilder {
fn new_contract_obj(
&self,
- ) -> multiversx_sc::types::heap::Box {
- multiversx_sc::types::heap::Box::new(ContractObj:: {
- _phantom: core::marker::PhantomData,
- })
+ ) -> multiversx_sc::types::heap::Box
+ {
+ multiversx_sc::types::heap::Box::new(self::contract_obj::())
}
}
}
diff --git a/framework/scenario/tests/contract_without_macros.rs b/framework/scenario/tests/contract_without_macros.rs
index 29189bf898..d0da5fac52 100644
--- a/framework/scenario/tests/contract_without_macros.rs
+++ b/framework/scenario/tests/contract_without_macros.rs
@@ -592,12 +592,9 @@ mod sample_adder {
/////////////////////////////////////////////////////////////////////////////////////////////////
//////// CONTRACT OBJECT ////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
- pub struct ContractObj
+ pub struct ContractObj(multiversx_sc::contract_base::UniversalContractObj)
where
- A: multiversx_sc::api::VMApi,
- {
- _phantom: core::marker::PhantomData,
- }
+ A: multiversx_sc::api::VMApi;
/////////////////////////////////////////////////////////////////////////////////////////////////
//////// CONTRACT OBJECT as CONTRACT BASE ///////////////////////////////////////////////////////
@@ -633,19 +630,17 @@ mod sample_adder {
where
A: multiversx_sc::api::VMApi,
{
- ContractObj {
- _phantom: core::marker::PhantomData,
- }
+ ContractObj::(multiversx_sc::contract_base::UniversalContractObj::::new())
}
+
pub struct ContractBuilder;
+
impl multiversx_sc::contract_base::CallableContractBuilder for self::ContractBuilder {
fn new_contract_obj(
&self,
) -> multiversx_sc::types::heap::Box
{
- multiversx_sc::types::heap::Box::new(ContractObj:: {
- _phantom: core::marker::PhantomData,
- })
+ multiversx_sc::types::heap::Box::new(self::contract_obj::())
}
}