Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chain sim - get_network_config_test #1825

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sdk/http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ description = "SDK for interacting with the MultiversX blockchain"
categories = ["cryptography::cryptocurrencies", "api-bindings"]
keywords = ["multiversx", "blockchain", "sdk", "api"]

[features]
chain_simulator = []

[dependencies]
tokio = { version = "1.24", features = ["full"] }
reqwest = { version = "0.12", features = ["blocking", "json"] }
Expand Down
1 change: 1 addition & 0 deletions sdk/http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub use multiversx_sdk as core;
pub const MAINNET_GATEWAY: &str = "https://gateway.multiversx.com";
pub const TESTNET_GATEWAY: &str = "https://testnet-gateway.multiversx.com";
pub const DEVNET_GATEWAY: &str = "https://devnet-gateway.multiversx.com";
pub const CHAIN_SIMULATOR_GATEWAY: &str = "http://localhost:8085";

// MetachainShardId will be used to identify a shard ID as metachain
pub const METACHAIN_SHARD_ID: u32 = 0xFFFFFFFF;
Expand Down
15 changes: 15 additions & 0 deletions sdk/http/tests/get_network_config_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use multiversx_sdk::gateway::NetworkConfigRequest;
use multiversx_sdk_http::{GatewayHttpProxy, CHAIN_SIMULATOR_GATEWAY};

#[tokio::test]
#[cfg_attr(not(feature = "chain_simulator"), ignore)]
async fn get_network_config_test() {
let blockchain = GatewayHttpProxy::new(CHAIN_SIMULATOR_GATEWAY.to_string());
let network_config = blockchain.http_request(NetworkConfigRequest).await.unwrap();

assert_eq!(network_config.chain_id, "chain");
assert_eq!(network_config.denomination, 18);
assert_eq!(network_config.num_shards_without_meta, 3);
assert_eq!(network_config.round_duration, 6000);
assert_eq!(network_config.shard_consensus_group_size, 1);
}
1 change: 1 addition & 0 deletions tools/rust-debugger/format-tests/tests/run_format_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
use std::{io::BufRead, path::Path, process::Command};

#[test]
#[ignore = "TODO: fix LLDB integration"]
fn run_format_tests() {
let home_dir = home::home_dir().unwrap();

Expand Down
Loading