Skip to content

Commit

Permalink
implemented execute deploy only for specific tx type
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaicalinluca committed Nov 21, 2023
1 parent e04a84f commit 07e3f44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions framework/base/src/types/interaction/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Env, Gas> Tx<Env, (), (), EgldPayment<Env::Api>, Gas, TxDataDeploy<Env>, ()>
where
Env: TxEnv,
Gas: TxGas<Env>,
{
pub fn execute_deploy(
&self,
) -> (
Expand All @@ -453,7 +459,7 @@ where
let wrap = SendRawWrapper::<Env::Api>::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(),
Expand Down
4 changes: 2 additions & 2 deletions framework/base/src/types/interaction/tx_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ where
}

fn get_code(&self) -> ManagedBuffer<Env::Api> {
self.code
self.code.clone()
}

fn get_metadata(&self) -> CodeMetadata {
self.metadata
}

fn get_args(&self) -> ManagedArgBuffer<Env::Api> {
self.arg_buffer
self.arg_buffer.clone()
}
}

Expand Down

0 comments on commit 07e3f44

Please sign in to comment.