diff --git a/framework/snippets/src/interactor_tx.rs b/framework/snippets/src/interactor_tx.rs index 2c8bed0fda..df84381dd8 100644 --- a/framework/snippets/src/interactor_tx.rs +++ b/framework/snippets/src/interactor_tx.rs @@ -10,8 +10,14 @@ mod interactor_query_call; mod interactor_query_env; mod interactor_query_step; -pub use interactor_exec_env::InteractorExecEnv; +pub use interactor_exec_env::InteractorEnvExec; pub use interactor_exec_step::InteractorExecStep; pub use interactor_prepare_async::InteractorPrepareAsync; -pub use interactor_query_env::InteractorQueryEnv; +pub use interactor_query_env::InteractorEnvQuery; pub use interactor_query_step::InteractorQueryStep; + +#[deprecated(since = "0.50.2", note = "Renamed to InteractorExecEnv")] +pub type InteractorExecEnv<'a> = InteractorEnvExec<'a>; + +#[deprecated(since = "0.50.2", note = "Renamed to InteractorEnvQuery")] +pub type InteractorQueryEnv<'a> = InteractorEnvQuery<'a>; diff --git a/framework/snippets/src/interactor_tx/interactor_exec_call.rs b/framework/snippets/src/interactor_tx/interactor_exec_call.rs index 71ff47c043..261ce44989 100644 --- a/framework/snippets/src/interactor_tx/interactor_exec_call.rs +++ b/framework/snippets/src/interactor_tx/interactor_exec_call.rs @@ -14,16 +14,16 @@ use multiversx_sc_scenario::{ use crate::Interactor; -use super::{InteractorExecEnv, InteractorExecStep, InteractorPrepareAsync}; +use super::{InteractorEnvExec, InteractorExecStep, InteractorPrepareAsync}; impl<'w, From, To, Payment, Gas, RH> InteractorPrepareAsync - for Tx, From, To, Payment, Gas, FunctionCall, RH> + for Tx, From, To, Payment, Gas, FunctionCall, RH> where - From: TxFromSpecified>, - To: TxToSpecified>, - Payment: TxPayment>, - Gas: TxGas>, - RH: RHListExec>, + From: TxFromSpecified>, + To: TxToSpecified>, + Payment: TxPayment>, + Gas: TxGas>, + RH: RHListExec>, RH::ListReturns: NestedTupleFlatten, { type Exec = InteractorExecStep<'w, ScCallStep, RH>; @@ -37,7 +37,7 @@ where impl<'w, RH> InteractorExecStep<'w, ScCallStep, RH> where - RH: RHListExec>, + RH: RHListExec>, RH::ListReturns: NestedTupleFlatten, { pub async fn run(mut self) -> ::Unpacked { diff --git a/framework/snippets/src/interactor_tx/interactor_exec_deploy.rs b/framework/snippets/src/interactor_tx/interactor_exec_deploy.rs index 30e30a34ab..6070158258 100644 --- a/framework/snippets/src/interactor_tx/interactor_exec_deploy.rs +++ b/framework/snippets/src/interactor_tx/interactor_exec_deploy.rs @@ -13,24 +13,24 @@ use multiversx_sc_scenario::{ use crate::Interactor; -use super::{InteractorExecEnv, InteractorExecStep, InteractorPrepareAsync}; +use super::{InteractorEnvExec, InteractorExecStep, InteractorPrepareAsync}; impl<'w, From, Payment, Gas, CodeValue, RH> InteractorPrepareAsync for Tx< - InteractorExecEnv<'w>, + InteractorEnvExec<'w>, From, (), Payment, Gas, - DeployCall, Code>, + DeployCall, Code>, RH, > where - From: TxFromSpecified>, - Payment: TxPayment>, - Gas: TxGas>, - CodeValue: TxCodeValue>, - RH: RHListExec>, + From: TxFromSpecified>, + Payment: TxPayment>, + Gas: TxGas>, + CodeValue: TxCodeValue>, + RH: RHListExec>, RH::ListReturns: NestedTupleFlatten, { type Exec = InteractorExecStep<'w, ScDeployStep, RH>; @@ -44,7 +44,7 @@ where impl<'w, RH> InteractorExecStep<'w, ScDeployStep, RH> where - RH: RHListExec>, + RH: RHListExec>, RH::ListReturns: NestedTupleFlatten, { pub async fn run(mut self) -> ::Unpacked { diff --git a/framework/snippets/src/interactor_tx/interactor_exec_env.rs b/framework/snippets/src/interactor_tx/interactor_exec_env.rs index 935164f7eb..6473c50a91 100644 --- a/framework/snippets/src/interactor_tx/interactor_exec_env.rs +++ b/framework/snippets/src/interactor_tx/interactor_exec_env.rs @@ -8,20 +8,20 @@ use multiversx_sc_scenario::{ use crate::Interactor; impl Interactor { - pub fn tx(&mut self) -> TxBaseWithEnv> { + pub fn tx(&mut self) -> TxBaseWithEnv> { let data = self.new_env_data(); - let env = InteractorExecEnv { world: self, data }; + let env = InteractorEnvExec { world: self, data }; Tx::new_with_env(env) } } /// Environment for executing transactions. -pub struct InteractorExecEnv<'w> { +pub struct InteractorEnvExec<'w> { pub world: &'w mut Interactor, pub data: ScenarioTxEnvData, } -impl<'w> TxEnv for InteractorExecEnv<'w> { +impl<'w> TxEnv for InteractorEnvExec<'w> { type Api = StaticApi; type RHExpect = TxExpect; @@ -39,7 +39,7 @@ impl<'w> TxEnv for InteractorExecEnv<'w> { } } -impl<'w> ScenarioTxEnv for InteractorExecEnv<'w> { +impl<'w> ScenarioTxEnv for InteractorEnvExec<'w> { fn env_data(&self) -> &ScenarioTxEnvData { &self.data } diff --git a/framework/snippets/src/interactor_tx/interactor_exec_step.rs b/framework/snippets/src/interactor_tx/interactor_exec_step.rs index 3becfe81d9..1d4eabf54d 100644 --- a/framework/snippets/src/interactor_tx/interactor_exec_step.rs +++ b/framework/snippets/src/interactor_tx/interactor_exec_step.rs @@ -4,12 +4,12 @@ use multiversx_sc_scenario::{ scenario_model::TxResponse, }; -use super::InteractorExecEnv; +use super::InteractorEnvExec; pub struct InteractorExecStep<'w, Step, RH> where - RH: RHListExec>, + RH: RHListExec>, RH::ListReturns: NestedTupleFlatten, { - pub(crate) step_wrapper: StepWrapper, Step, RH>, + pub(crate) step_wrapper: StepWrapper, Step, RH>, } diff --git a/framework/snippets/src/interactor_tx/interactor_exec_transf.rs b/framework/snippets/src/interactor_tx/interactor_exec_transf.rs index a19d54548d..3ec04c0b05 100644 --- a/framework/snippets/src/interactor_tx/interactor_exec_transf.rs +++ b/framework/snippets/src/interactor_tx/interactor_exec_transf.rs @@ -4,15 +4,15 @@ use multiversx_sc_scenario::{ scenario_model::TransferStep, }; -use super::{InteractorExecEnv, InteractorExecStep, InteractorPrepareAsync}; +use super::{InteractorEnvExec, InteractorExecStep, InteractorPrepareAsync}; impl<'w, From, To, Payment, Gas> InteractorPrepareAsync - for Tx, From, To, Payment, Gas, (), ()> + for Tx, From, To, Payment, Gas, (), ()> where - From: TxFromSpecified>, - To: TxToSpecified>, - Payment: TxPayment>, - Gas: TxGas>, + From: TxFromSpecified>, + To: TxToSpecified>, + Payment: TxPayment>, + Gas: TxGas>, { type Exec = InteractorExecStep<'w, TransferStep, ()>; diff --git a/framework/snippets/src/interactor_tx/interactor_query_call.rs b/framework/snippets/src/interactor_tx/interactor_query_call.rs index 9068b906e5..5e35b5409b 100644 --- a/framework/snippets/src/interactor_tx/interactor_query_call.rs +++ b/framework/snippets/src/interactor_tx/interactor_query_call.rs @@ -11,14 +11,14 @@ use multiversx_sc_scenario::{ use crate::Interactor; -use super::{InteractorPrepareAsync, InteractorQueryEnv, InteractorQueryStep}; +use super::{InteractorEnvQuery, InteractorPrepareAsync, InteractorQueryStep}; impl<'w, To, Payment, RH> InteractorPrepareAsync - for Tx, (), To, Payment, (), FunctionCall, RH> + for Tx, (), To, Payment, (), FunctionCall, RH> where - To: TxToSpecified>, - Payment: TxNoPayment>, - RH: RHListExec>, + To: TxToSpecified>, + Payment: TxNoPayment>, + RH: RHListExec>, RH::ListReturns: NestedTupleFlatten, { type Exec = InteractorQueryStep<'w, RH>; @@ -32,7 +32,7 @@ where impl<'w, RH> InteractorQueryStep<'w, RH> where - RH: RHListExec>, + RH: RHListExec>, RH::ListReturns: NestedTupleFlatten, { pub async fn run(mut self) -> ::Unpacked { diff --git a/framework/snippets/src/interactor_tx/interactor_query_env.rs b/framework/snippets/src/interactor_tx/interactor_query_env.rs index 1fa1142111..71dcd2f3b4 100644 --- a/framework/snippets/src/interactor_tx/interactor_query_env.rs +++ b/framework/snippets/src/interactor_tx/interactor_query_env.rs @@ -8,19 +8,19 @@ use multiversx_sc_scenario::{ use crate::Interactor; impl Interactor { - pub fn query(&mut self) -> TxBaseWithEnv> { + pub fn query(&mut self) -> TxBaseWithEnv> { let data = self.new_env_data(); - let env = InteractorQueryEnv { world: self, data }; + let env = InteractorEnvQuery { world: self, data }; Tx::new_with_env(env) } } -pub struct InteractorQueryEnv<'w> { +pub struct InteractorEnvQuery<'w> { pub world: &'w mut Interactor, pub data: ScenarioTxEnvData, } -impl<'w> TxEnv for InteractorQueryEnv<'w> { +impl<'w> TxEnv for InteractorEnvQuery<'w> { type Api = StaticApi; type RHExpect = TxExpect; @@ -38,7 +38,7 @@ impl<'w> TxEnv for InteractorQueryEnv<'w> { } } -impl<'w> ScenarioTxEnv for InteractorQueryEnv<'w> { +impl<'w> ScenarioTxEnv for InteractorEnvQuery<'w> { fn env_data(&self) -> &ScenarioTxEnvData { &self.data } diff --git a/framework/snippets/src/interactor_tx/interactor_query_step.rs b/framework/snippets/src/interactor_tx/interactor_query_step.rs index 81c7542add..bbb7a0996b 100644 --- a/framework/snippets/src/interactor_tx/interactor_query_step.rs +++ b/framework/snippets/src/interactor_tx/interactor_query_step.rs @@ -4,12 +4,12 @@ use multiversx_sc_scenario::{ scenario_model::{ScQueryStep, TxResponse}, }; -use super::InteractorQueryEnv; +use super::InteractorEnvQuery; pub struct InteractorQueryStep<'w, RH> where - RH: RHListExec>, + RH: RHListExec>, RH::ListReturns: NestedTupleFlatten, { - pub(crate) step_wrapper: StepWrapper, ScQueryStep, RH>, + pub(crate) step_wrapper: StepWrapper, ScQueryStep, RH>, } diff --git a/framework/snippets/src/multi/homogenous_tx_buffer.rs b/framework/snippets/src/multi/homogenous_tx_buffer.rs index da177d1658..66f5dec79f 100644 --- a/framework/snippets/src/multi/homogenous_tx_buffer.rs +++ b/framework/snippets/src/multi/homogenous_tx_buffer.rs @@ -8,10 +8,10 @@ use multiversx_sc_scenario::{ ScenarioTxEnvData, }; -use crate::{Interactor, InteractorExecEnv, InteractorStep, StepBuffer}; +use crate::{Interactor, InteractorEnvExec, InteractorStep, StepBuffer}; pub struct HomogenousTxBuffer<'w, Step, RH> { - env: InteractorExecEnv<'w>, + env: InteractorEnvExec<'w>, steps: Vec>, } @@ -22,7 +22,7 @@ impl Interactor { /// Therefore, after execution, all results will have the same type. pub fn homogenous_call_buffer(&mut self) -> HomogenousTxBuffer<'_, Step, RH> { let data = self.new_env_data(); - let env = InteractorExecEnv { world: self, data }; + let env = InteractorEnvExec { world: self, data }; HomogenousTxBuffer { env, steps: Vec::new(),