From 07e3f4430712018317a8eb1ec82f0eca46a14b8c Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Tue, 21 Nov 2023 17:18:53 +0100 Subject: [PATCH] implemented execute deploy only for specific tx type --- framework/base/src/types/interaction/tx.rs | 10 ++++++++-- framework/base/src/types/interaction/tx_data.rs | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/framework/base/src/types/interaction/tx.rs b/framework/base/src/types/interaction/tx.rs index a911928e49..a694bdbaef 100644 --- a/framework/base/src/types/interaction/tx.rs +++ b/framework/base/src/types/interaction/tx.rs @@ -437,13 +437,19 @@ where env: self.env, from: self.from, to: self.to, - payment: self.payment, + payment: self.payment, //this should be egld payment only gas: self.gas, data: TxDataDeploy::new(code, metadata, arg_buffer), callback: self.callback, } } +} +impl Tx, Gas, TxDataDeploy, ()> +where + Env: TxEnv, + Gas: TxGas, +{ pub fn execute_deploy( &self, ) -> ( @@ -453,7 +459,7 @@ where let wrap = SendRawWrapper::::new(); wrap.deploy_contract( self.gas.resolve_gas(&self.env), - &self.payment, + &self.payment.value, &self.data.get_code(), self.data.get_metadata(), &self.data.get_args(), diff --git a/framework/base/src/types/interaction/tx_data.rs b/framework/base/src/types/interaction/tx_data.rs index 0f9d763fb1..f27d3b80a5 100644 --- a/framework/base/src/types/interaction/tx_data.rs +++ b/framework/base/src/types/interaction/tx_data.rs @@ -104,7 +104,7 @@ where } fn get_code(&self) -> ManagedBuffer { - self.code + self.code.clone() } fn get_metadata(&self) -> CodeMetadata { @@ -112,7 +112,7 @@ where } fn get_args(&self) -> ManagedArgBuffer { - self.arg_buffer + self.arg_buffer.clone() } }