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

respect wasm-dir on init-network #3432

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion crates/apps_lib/src/cli/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ impl CliApi {
utils::validate_wasm(args)
}
ClientUtils::InitNetwork(InitNetwork(args)) => {
utils::init_network(args);
utils::init_network(global_args, args);
}
ClientUtils::GenesisBond(GenesisBond(args)) => {
utils::genesis_bond(args)
Expand Down
9 changes: 6 additions & 3 deletions crates/apps_lib/src/client/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ pub fn id_from_pk(pk: &common::PublicKey) -> TendermintNodeId {

/// Initialize a new test network from the given configuration.
pub fn init_network(
global_args: args::Global,
args::InitNetwork {
templates_path,
wasm_checksums_path,
Expand Down Expand Up @@ -393,9 +394,11 @@ pub fn init_network(
// Try to copy the built WASM, if they're present with the checksums
let checksums = wasm_loader::Checksums::read_checksums(&wasm_dir_full)
.unwrap_or_else(|_| safe_exit(1));
let base_wasm_path = std::env::current_dir()
.unwrap()
.join(crate::config::DEFAULT_WASM_DIR);
let base_wasm_path = global_args.wasm_dir.unwrap_or_else(|| {
std::env::current_dir()
.unwrap()
.join(crate::config::DEFAULT_WASM_DIR)
});
for (_, full_name) in checksums.0 {
// try to copy built file from the Namada WASM root dir
let file = base_wasm_path.join(&full_name);
Expand Down
8 changes: 5 additions & 3 deletions crates/tests/src/integration/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,17 @@ pub fn initialize_genesis(
};

// Create genesis chain release archive
let release_archive_path =
namada_apps_lib::client::utils::init_network(args::InitNetwork {
let release_archive_path = namada_apps_lib::client::utils::init_network(
global_args.clone(),
args::InitNetwork {
templates_path: genesis_path,
wasm_checksums_path,
chain_id_prefix,
consensus_timeout_commit: Timeout::from_str("30s").unwrap(),
archive_dir: None,
genesis_time,
});
},
);

// Decode and unpack the release archive
let mut archive = {
Expand Down
Loading