Skip to content

Commit

Permalink
Merge branch 'develop' into ci/print-clippy-version
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez authored Aug 22, 2024
2 parents b9bbd20 + 5977096 commit d617606
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 18 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/iota/src/iota_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ pub enum IotaCommand {
/// We can use any config dir that is generated by `iota genesis`.
#[clap(short, long)]
config_dir: Option<std::path::PathBuf>,
/// Sets the fullnode_count in the SwarmBuilder to 0, so the JSON RPC
/// port stays unused.
#[clap(long = "no-full-node")]
no_full_node: bool,
},
Expand Down
47 changes: 47 additions & 0 deletions crates/iota/tests/cli_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,53 @@ async fn test_genesis() -> Result<(), anyhow::Error> {
Ok(())
}

#[sim_test]
async fn test_start() -> Result<(), anyhow::Error> {
let temp_dir = tempfile::tempdir()?;
let working_dir = temp_dir.path();

if let Ok(res) = tokio::time::timeout(
Duration::from_secs(10),
IotaCommand::Start {
config_dir: Some(working_dir.to_path_buf()),
no_full_node: false,
}
.execute(),
)
.await
{
res.unwrap();
};

// Get all the new file names
let files = read_dir(working_dir)?
.flat_map(|r| r.map(|file| file.file_name().to_str().unwrap().to_owned()))
.collect::<Vec<_>>();
assert_eq!(12, files.len());
assert!(files.contains(&IOTA_CLIENT_CONFIG.to_string()));
assert!(files.contains(&IOTA_NETWORK_CONFIG.to_string()));
assert!(files.contains(&IOTA_FULLNODE_CONFIG.to_string()));
assert!(files.contains(&IOTA_GENESIS_FILENAME.to_string()));
assert!(files.contains(&IOTA_KEYSTORE_FILENAME.to_string()));
assert!(files.contains(&IOTA_KEYSTORE_ALIASES_FILENAME.to_string()));

// Check network config
let network_conf =
PersistedConfig::<NetworkConfigLight>::read(&working_dir.join(IOTA_NETWORK_CONFIG))?;
assert_eq!(4, network_conf.validator_configs().len());

// Check wallet config
let wallet_conf =
PersistedConfig::<IotaClientConfig>::read(&working_dir.join(IOTA_CLIENT_CONFIG))?;

assert!(!wallet_conf.envs.is_empty());

assert_eq!(5, wallet_conf.keystore.addresses().len());

temp_dir.close()?;
Ok(())
}

#[tokio::test]
async fn test_addresses_command() -> Result<(), anyhow::Error> {
let test_cluster = TestClusterBuilder::new().build().await;
Expand Down
36 changes: 26 additions & 10 deletions external-crates/move/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion external-crates/move/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ log = { version = "0.4", features = ["serde"] }
num = "0.4"
once_cell = "1.19"
parking_lot = "0.12"
petgraph = "0.6"
petgraph = "0.5.1"
proptest = "1.5"
proptest-derive = "0.5"
rand = "0.8"
Expand Down

0 comments on commit d617606

Please sign in to comment.