diff --git a/Cargo.lock b/Cargo.lock
index a1fa41dbad..6784e98b6e 100755
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2418,6 +2418,7 @@ dependencies = [
name = "multiversx-sc-snippets"
version = "0.53.1"
dependencies = [
+ "anyhow",
"base64",
"env_logger",
"futures",
@@ -2425,6 +2426,7 @@ dependencies = [
"log",
"multiversx-chain-scenario-format",
"multiversx-sc-scenario",
+ "multiversx-sdk",
"multiversx-sdk-http",
"serde_json",
"tokio",
diff --git a/contracts/examples/adder/interact/src/basic_interact.rs b/contracts/examples/adder/interact/src/basic_interact.rs
index 27a3bbb166..b0a4801a4a 100644
--- a/contracts/examples/adder/interact/src/basic_interact.rs
+++ b/contracts/examples/adder/interact/src/basic_interact.rs
@@ -84,11 +84,7 @@ impl AdderInteract {
.await;
// generate blocks until ESDTSystemSCAddress is enabled
- interactor
- .proxy
- .generate_blocks_until_epoch(1)
- .await
- .unwrap();
+ interactor.generate_blocks_until_epoch(1).await.unwrap();
Self {
interactor,
diff --git a/framework/snippets/Cargo.toml b/framework/snippets/Cargo.toml
index a3a3011d45..ceaaddf119 100644
--- a/framework/snippets/Cargo.toml
+++ b/framework/snippets/Cargo.toml
@@ -20,6 +20,7 @@ base64 = "0.22"
log = "0.4.17"
env_logger = "0.11"
futures = "0.3"
+anyhow = "1.0.44"
[dependencies.multiversx-sc-scenario]
version = "=0.53.1"
@@ -29,6 +30,10 @@ path = "../scenario"
version = "0.23.0"
path = "../../sdk/scenario-format"
+[dependencies.multiversx-sdk]
+version = "=0.6.1"
+path = "../../sdk/core"
+
[dependencies.multiversx-sdk-http]
version = "=0.6.1"
path = "../../sdk/http"
diff --git a/framework/snippets/src/account_tool.rs b/framework/snippets/src/account_tool.rs
index df51497df8..660f27e10a 100644
--- a/framework/snippets/src/account_tool.rs
+++ b/framework/snippets/src/account_tool.rs
@@ -16,9 +16,10 @@ pub async fn print_account_as_scenario_set_state(
use_chain_simulator: bool,
address_bech32_string: String,
) {
- let api = GatewayHttpProxy::new(api_string, use_chain_simulator);
+ let api = GatewayHttpProxy::new(api_string);
let address = Bech32Address::from_bech32_string(address_bech32_string);
- let set_state = retrieve_account_as_scenario_set_state(&api, &address).await;
+ let set_state =
+ retrieve_account_as_scenario_set_state(&api, use_chain_simulator, &address).await;
let scenario = build_scenario(set_state);
println!("{}", scenario.into_raw().to_json_string());
}
@@ -34,12 +35,13 @@ fn build_scenario(set_state: SetStateStep) -> Scenario {
pub async fn retrieve_account_as_scenario_set_state(
api: &GatewayHttpProxy,
+ use_chain_simulator: bool,
address: &Bech32Address,
) -> SetStateStep {
let sdk_address = Address::from_bech32_string(address.to_bech32_str()).unwrap();
let sdk_account = api.get_account(&sdk_address).await.unwrap();
- let (account_esdt, account_esdt_roles, account_storage) = if api.chain_simulator {
+ let (account_esdt, account_esdt_roles, account_storage) = if use_chain_simulator {
(HashMap::new(), HashMap::new(), HashMap::new())
} else {
let account_esdt = api
diff --git a/framework/snippets/src/interactor.rs b/framework/snippets/src/interactor.rs
index bf1b517743..461e120ca0 100644
--- a/framework/snippets/src/interactor.rs
+++ b/framework/snippets/src/interactor.rs
@@ -17,6 +17,7 @@ pub const INTERACTOR_SCENARIO_TRACE_PATH: &str = "interactor_trace.scen.json";
pub struct Interactor {
pub proxy: GatewayHttpProxy,
+ pub use_chain_simulator: bool,
pub network_config: NetworkConfig,
pub sender_map: HashMap
,
@@ -29,10 +30,11 @@ pub struct Interactor {
impl Interactor {
pub async fn new(gateway_uri: &str, use_chain_simulator: bool) -> Self {
- let proxy = GatewayHttpProxy::new(gateway_uri.to_string(), use_chain_simulator);
+ let proxy = GatewayHttpProxy::new(gateway_uri.to_string());
let network_config = proxy.get_network_config().await.unwrap();
Self {
proxy,
+ use_chain_simulator,
network_config,
sender_map: HashMap::new(),
waiting_time_ms: 0,
@@ -44,10 +46,8 @@ impl Interactor {
pub async fn register_wallet(&mut self, wallet: Wallet) -> Address {
let wallet_address = wallet.address();
- self.proxy
- .send_user_funds(&wallet_address.to_bech32_string().unwrap())
- .await
- .unwrap();
+
+ self.send_user_funds(&wallet_address).await.unwrap();
let address: Address = wallet_address.into();
self.sender_map.insert(
@@ -72,7 +72,12 @@ impl Interactor {
}
pub async fn retrieve_account(&mut self, wallet_address: &Bech32Address) {
- let set_state = retrieve_account_as_scenario_set_state(&self.proxy, wallet_address).await;
+ let set_state = retrieve_account_as_scenario_set_state(
+ &self.proxy,
+ self.use_chain_simulator,
+ wallet_address,
+ )
+ .await;
self.pre_runners.run_set_state_step(&set_state);
self.post_runners.run_set_state_step(&set_state);
}
diff --git a/framework/snippets/src/interactor_chain_simulator.rs b/framework/snippets/src/interactor_chain_simulator.rs
new file mode 100644
index 0000000000..b0c9fb92c0
--- /dev/null
+++ b/framework/snippets/src/interactor_chain_simulator.rs
@@ -0,0 +1,57 @@
+use anyhow::Error;
+use multiversx_sdk::{
+ data::address::Address,
+ gateway::{
+ ChainSimulatorGenerateBlocksRequest, ChainSimulatorSendFundsRequest, GatewayAsyncService,
+ },
+};
+
+use crate::Interactor;
+
+impl Interactor {
+ pub async fn send_user_funds(&self, receiver: &Address) -> Result {
+ if !self.use_chain_simulator {
+ return Ok(String::from("no-simulator"));
+ }
+
+ self.proxy
+ .request(ChainSimulatorSendFundsRequest::to_address(
+ receiver.to_bech32_string().unwrap(),
+ ))
+ .await
+ }
+
+ pub async fn generate_blocks(&self, num_blocks: u64) -> Result {
+ if !self.use_chain_simulator {
+ return Ok(String::from("no-simulator"));
+ }
+
+ self.proxy
+ .request(ChainSimulatorGenerateBlocksRequest::num_blocks(num_blocks))
+ .await
+ }
+
+ pub async fn generate_blocks_until_epoch(&self, epoch_number: u64) -> Result {
+ if !self.use_chain_simulator {
+ return Ok(String::from("no-simulator"));
+ }
+
+ self.proxy
+ .request(ChainSimulatorGenerateBlocksRequest::until_epoch(
+ epoch_number,
+ ))
+ .await
+ }
+
+ pub async fn generate_blocks_until_tx_processed(&self, tx_hash: &str) -> Result {
+ if !self.use_chain_simulator {
+ return Ok(String::from("no-simulator"));
+ }
+
+ self.proxy
+ .request(ChainSimulatorGenerateBlocksRequest::until_tx_processed(
+ tx_hash,
+ ))
+ .await
+ }
+}
diff --git a/framework/snippets/src/interactor_scenario/interactor_sc_call.rs b/framework/snippets/src/interactor_scenario/interactor_sc_call.rs
index 112e5aba0e..cc3808dce1 100644
--- a/framework/snippets/src/interactor_scenario/interactor_sc_call.rs
+++ b/framework/snippets/src/interactor_scenario/interactor_sc_call.rs
@@ -14,8 +14,7 @@ impl Interactor {
{
let sc_call_step = sc_call_step.as_mut();
let tx_hash = self.launch_sc_call(sc_call_step).await;
- self.proxy
- .generate_blocks_until_tx_processed(&tx_hash)
+ self.generate_blocks_until_tx_processed(&tx_hash)
.await
.unwrap();
let tx = self.proxy.retrieve_tx_on_network(tx_hash.clone()).await;
diff --git a/framework/snippets/src/interactor_scenario/interactor_sc_deploy.rs b/framework/snippets/src/interactor_scenario/interactor_sc_deploy.rs
index 331af64752..1228dd00d4 100644
--- a/framework/snippets/src/interactor_scenario/interactor_sc_deploy.rs
+++ b/framework/snippets/src/interactor_scenario/interactor_sc_deploy.rs
@@ -48,8 +48,7 @@ impl Interactor {
{
let sc_deploy_step = sc_deploy_step.as_mut();
let tx_hash = self.launch_sc_deploy(sc_deploy_step).await;
- self.proxy
- .generate_blocks_until_tx_processed(&tx_hash)
+ self.generate_blocks_until_tx_processed(&tx_hash)
.await
.unwrap();
let tx = self.proxy.retrieve_tx_on_network(tx_hash.clone()).await;
diff --git a/framework/snippets/src/interactor_scenario/interactor_transfer.rs b/framework/snippets/src/interactor_scenario/interactor_transfer.rs
index 53da3a64b9..2bdef581ac 100644
--- a/framework/snippets/src/interactor_scenario/interactor_transfer.rs
+++ b/framework/snippets/src/interactor_scenario/interactor_transfer.rs
@@ -11,8 +11,7 @@ impl Interactor {
self.set_nonce_and_sign_tx(sender_address, &mut transaction)
.await;
let tx_hash = self.proxy.send_transaction(&transaction).await.unwrap();
- self.proxy
- .generate_blocks_until_tx_processed(&tx_hash)
+ self.generate_blocks_until_tx_processed(&tx_hash)
.await
.unwrap();
diff --git a/framework/snippets/src/lib.rs b/framework/snippets/src/lib.rs
index d3e51792f2..a0aec0df37 100644
--- a/framework/snippets/src/lib.rs
+++ b/framework/snippets/src/lib.rs
@@ -1,5 +1,6 @@
pub mod account_tool;
mod interactor;
+mod interactor_chain_simulator;
mod interactor_dns;
mod interactor_scenario;
mod interactor_sender;
diff --git a/framework/snippets/src/multi/interactor_multi_sc_process.rs b/framework/snippets/src/multi/interactor_multi_sc_process.rs
index a0510a8161..de5a138ce2 100644
--- a/framework/snippets/src/multi/interactor_multi_sc_process.rs
+++ b/framework/snippets/src/multi/interactor_multi_sc_process.rs
@@ -34,7 +34,7 @@ impl Interactor {
futures.push(self.proxy.retrieve_tx_on_network(tx_hash.clone()));
}
- self.proxy.generate_blocks(4).await.unwrap();
+ self.generate_blocks(4).await.unwrap();
join_all(futures).await
}
}
diff --git a/sdk/http/examples/account.rs b/sdk/http/examples/account.rs
index c7348cd156..a7265af3d3 100644
--- a/sdk/http/examples/account.rs
+++ b/sdk/http/examples/account.rs
@@ -1,5 +1,5 @@
use multiversx_sdk::data::address::Address;
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
@@ -8,7 +8,7 @@ async fn main() {
)
.unwrap();
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let account = blockchain.get_account(&addr).await.unwrap();
println!("account: {account:#?}");
diff --git a/sdk/http/examples/account_storage.rs b/sdk/http/examples/account_storage.rs
index e957f59926..688805b4e5 100644
--- a/sdk/http/examples/account_storage.rs
+++ b/sdk/http/examples/account_storage.rs
@@ -1,5 +1,5 @@
use multiversx_sdk::data::address::Address;
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
@@ -8,7 +8,7 @@ async fn main() {
)
.unwrap();
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let account_storage = blockchain.get_account_storage_keys(&addr).await.unwrap();
println!("Account Storage: {account_storage:#?}");
diff --git a/sdk/http/examples/get_esdt_tokens.rs b/sdk/http/examples/get_esdt_tokens.rs
index 97f51132dd..1ff4116919 100644
--- a/sdk/http/examples/get_esdt_tokens.rs
+++ b/sdk/http/examples/get_esdt_tokens.rs
@@ -1,5 +1,5 @@
use multiversx_sdk::data::address::Address;
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
@@ -8,7 +8,7 @@ async fn main() {
)
.unwrap();
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let balances = blockchain.get_account_esdt_tokens(&addr).await.unwrap();
println!("{balances:#?}");
diff --git a/sdk/http/examples/get_hyper_block_by_hash.rs b/sdk/http/examples/get_hyper_block_by_hash.rs
index f4687880d8..db42e77599 100644
--- a/sdk/http/examples/get_hyper_block_by_hash.rs
+++ b/sdk/http/examples/get_hyper_block_by_hash.rs
@@ -1,8 +1,8 @@
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let result = blockchain
.get_hyper_block_by_hash("d59e0dc7d407b1175655357cb8056ec3bb77961192753cddda2fb700c6ce71c6")
.await;
diff --git a/sdk/http/examples/get_hyper_block_by_nonce.rs b/sdk/http/examples/get_hyper_block_by_nonce.rs
index 88e08f10bd..39c88dd14f 100644
--- a/sdk/http/examples/get_hyper_block_by_nonce.rs
+++ b/sdk/http/examples/get_hyper_block_by_nonce.rs
@@ -1,8 +1,8 @@
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let result = blockchain.get_hyper_block_by_nonce(7468).await;
println!("block by nonce result: {result:#?}")
diff --git a/sdk/http/examples/get_hyper_block_latest.rs b/sdk/http/examples/get_hyper_block_latest.rs
index c38e528c64..522a7aa52b 100644
--- a/sdk/http/examples/get_hyper_block_latest.rs
+++ b/sdk/http/examples/get_hyper_block_latest.rs
@@ -1,8 +1,8 @@
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let result = blockchain.get_latest_hyper_block_nonce().await;
println!("latest block result: {result:?}")
diff --git a/sdk/http/examples/get_network_config.rs b/sdk/http/examples/get_network_config.rs
index 3e34deb6aa..daea7e5baf 100644
--- a/sdk/http/examples/get_network_config.rs
+++ b/sdk/http/examples/get_network_config.rs
@@ -1,8 +1,8 @@
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let network_config = blockchain.get_network_config().await.unwrap();
println!("network_config: {network_config:#?}")
diff --git a/sdk/http/examples/get_network_economics.rs b/sdk/http/examples/get_network_economics.rs
index a73a2c5b0a..5e1bc6de93 100644
--- a/sdk/http/examples/get_network_economics.rs
+++ b/sdk/http/examples/get_network_economics.rs
@@ -1,8 +1,8 @@
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let network_economics = blockchain.get_network_economics().await.unwrap();
println!("network_economics: {network_economics:#?}")
diff --git a/sdk/http/examples/sign_tx.rs b/sdk/http/examples/sign_tx.rs
index 713db7fe3c..a2e15d4226 100644
--- a/sdk/http/examples/sign_tx.rs
+++ b/sdk/http/examples/sign_tx.rs
@@ -1,5 +1,5 @@
use multiversx_sdk::{data::transaction::Transaction, wallet::Wallet};
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
@@ -8,7 +8,7 @@ async fn main() {
)
.unwrap();
let addr = wl.address();
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let network_config = blockchain.get_network_config().await.unwrap();
let arg = blockchain
diff --git a/sdk/http/examples/sign_txs.rs b/sdk/http/examples/sign_txs.rs
index 4b35e2d032..272a89f720 100644
--- a/sdk/http/examples/sign_txs.rs
+++ b/sdk/http/examples/sign_txs.rs
@@ -1,5 +1,5 @@
use multiversx_sdk::{data::transaction::Transaction, wallet::Wallet};
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
@@ -8,7 +8,7 @@ async fn main() {
)
.unwrap();
let addr = wl.address();
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let network_config = blockchain.get_network_config().await.unwrap();
let arg = blockchain
diff --git a/sdk/http/examples/tx_cost.rs b/sdk/http/examples/tx_cost.rs
index ff08a7be35..a01c7dae3e 100644
--- a/sdk/http/examples/tx_cost.rs
+++ b/sdk/http/examples/tx_cost.rs
@@ -2,7 +2,7 @@ use multiversx_sdk::{
data::{address::Address, transaction::Transaction},
utils::base64_encode,
};
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
@@ -26,7 +26,7 @@ async fn main() {
signature: None,
};
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let cost = blockchain.request_transaction_cost(&tx).await.unwrap();
println!("tx cost: {cost:#?}");
diff --git a/sdk/http/examples/tx_default_args.rs b/sdk/http/examples/tx_default_args.rs
index 13235cc0a6..bb9914b1a0 100644
--- a/sdk/http/examples/tx_default_args.rs
+++ b/sdk/http/examples/tx_default_args.rs
@@ -1,9 +1,9 @@
use multiversx_sdk::data::address::Address;
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let network_config = blockchain.get_network_config().await.unwrap();
let addr = Address::from_bech32_string(
"erd1qqqqqqqqqqqqqpgqfzydqmdw7m2vazsp6u5p95yxz76t2p9rd8ss0zp9ts",
diff --git a/sdk/http/examples/tx_info.rs b/sdk/http/examples/tx_info.rs
index 753828bb84..b5dd818354 100644
--- a/sdk/http/examples/tx_info.rs
+++ b/sdk/http/examples/tx_info.rs
@@ -1,9 +1,9 @@
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
let tx_hash = "fd21782ddb9e2217a3239e849e39d1d2c8fa74142a73f2dda3adb3028c0514e9";
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let status = blockchain.get_transaction_status(tx_hash).await;
println!("tx status: {status:?}");
diff --git a/sdk/http/examples/vm_query.rs b/sdk/http/examples/vm_query.rs
index 76441840ac..b933026dcd 100644
--- a/sdk/http/examples/vm_query.rs
+++ b/sdk/http/examples/vm_query.rs
@@ -1,9 +1,9 @@
use multiversx_sdk::data::{address::Address, vm::VMQueryInput};
-use multiversx_sdk_http::{GatewayHttpProxy, DEFAULT_USE_CHAIN_SIMULATOR, DEVNET_GATEWAY};
+use multiversx_sdk_http::{GatewayHttpProxy, DEVNET_GATEWAY};
#[tokio::main]
async fn main() {
- let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string(), DEFAULT_USE_CHAIN_SIMULATOR);
+ let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
let sc_address = Address::from_bech32_string(
"erd1qqqqqqqqqqqqqpgq5dvvkmka7sujfsx7cfmygnx0n7luv8k0d8sskpqcec",
)
diff --git a/sdk/http/src/gateway_http_proxy.rs b/sdk/http/src/gateway_http_proxy.rs
index deb1e214bc..61b6990b8e 100644
--- a/sdk/http/src/gateway_http_proxy.rs
+++ b/sdk/http/src/gateway_http_proxy.rs
@@ -12,15 +12,13 @@ use multiversx_sdk::gateway::{GatewayAsyncService, GatewayRequest};
pub struct GatewayHttpProxy {
pub(crate) proxy_uri: String,
pub(crate) client: reqwest::Client,
- pub chain_simulator: bool,
}
impl GatewayHttpProxy {
- pub fn new(proxy_uri: String, chain_simulator: bool) -> Self {
+ pub fn new(proxy_uri: String) -> Self {
Self {
proxy_uri,
client: reqwest::Client::new(),
- chain_simulator,
}
}
diff --git a/sdk/http/src/gateway_http_proxy/http_chain_simulator.rs b/sdk/http/src/gateway_http_proxy/http_chain_simulator.rs
index 0a68349c02..7da3940fad 100644
--- a/sdk/http/src/gateway_http_proxy/http_chain_simulator.rs
+++ b/sdk/http/src/gateway_http_proxy/http_chain_simulator.rs
@@ -6,10 +6,6 @@ use multiversx_sdk::gateway::{
impl GatewayHttpProxy {
pub async fn send_user_funds(&self, receiver: &str) -> Result {
- if !self.chain_simulator {
- return Ok(String::from("no-simulator"));
- }
-
self.request(ChainSimulatorSendFundsRequest::to_address(
receiver.to_owned(),
))
@@ -17,19 +13,11 @@ impl GatewayHttpProxy {
}
pub async fn generate_blocks(&self, num_blocks: u64) -> Result {
- if !self.chain_simulator {
- return Ok(String::from("no-simulator"));
- }
-
self.request(ChainSimulatorGenerateBlocksRequest::num_blocks(num_blocks))
.await
}
pub async fn generate_blocks_until_epoch(&self, epoch_number: u64) -> Result {
- if !self.chain_simulator {
- return Ok(String::from("no-simulator"));
- }
-
self.request(ChainSimulatorGenerateBlocksRequest::until_epoch(
epoch_number,
))
@@ -37,10 +25,6 @@ impl GatewayHttpProxy {
}
pub async fn generate_blocks_until_tx_processed(&self, tx_hash: &str) -> Result {
- if !self.chain_simulator {
- return Ok(String::from("no-simulator"));
- }
-
self.request(ChainSimulatorGenerateBlocksRequest::until_tx_processed(
tx_hash,
))
diff --git a/tools/interactor-system-func-calls/src/system_sc_interact.rs b/tools/interactor-system-func-calls/src/system_sc_interact.rs
index e3ba495a2c..97d72beb01 100644
--- a/tools/interactor-system-func-calls/src/system_sc_interact.rs
+++ b/tools/interactor-system-func-calls/src/system_sc_interact.rs
@@ -233,11 +233,7 @@ impl SysFuncCallsInteract {
let wallet_address = interactor.register_wallet(test_wallets::alice()).await;
// generate blocks until ESDTSystemSCAddress is enabled
- interactor
- .proxy
- .generate_blocks_until_epoch(1)
- .await
- .unwrap();
+ interactor.generate_blocks_until_epoch(1).await.unwrap();
Self {
interactor,