Skip to content

Commit 71ce06f

Browse files
committed
Merge branch 'fraccaman/respect-wasm-dir' (#3432)
* origin/fraccaman/respect-wasm-dir: added changelog respect warm-dir on init-network
2 parents 91d82c9 + dd4506e commit 71ce06f

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Respect --wasm-dir on init-network.
2+
([\#3432](https://github.com/anoma/namada/pull/3432))

crates/apps_lib/src/cli/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ impl CliApi {
766766
utils::validate_wasm(args)
767767
}
768768
ClientUtils::InitNetwork(InitNetwork(args)) => {
769-
utils::init_network(args);
769+
utils::init_network(global_args, args);
770770
}
771771
ClientUtils::GenesisBond(GenesisBond(args)) => {
772772
utils::genesis_bond(args)

crates/apps_lib/src/client/utils.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ pub fn id_from_pk(pk: &common::PublicKey) -> TendermintNodeId {
301301

302302
/// Initialize a new test network from the given configuration.
303303
pub fn init_network(
304+
global_args: args::Global,
304305
args::InitNetwork {
305306
templates_path,
306307
wasm_checksums_path,
@@ -393,9 +394,11 @@ pub fn init_network(
393394
// Try to copy the built WASM, if they're present with the checksums
394395
let checksums = wasm_loader::Checksums::read_checksums(&wasm_dir_full)
395396
.unwrap_or_else(|_| safe_exit(1));
396-
let base_wasm_path = std::env::current_dir()
397-
.unwrap()
398-
.join(crate::config::DEFAULT_WASM_DIR);
397+
let base_wasm_path = global_args.wasm_dir.unwrap_or_else(|| {
398+
std::env::current_dir()
399+
.unwrap()
400+
.join(crate::config::DEFAULT_WASM_DIR)
401+
});
399402
for (_, full_name) in checksums.0 {
400403
// try to copy built file from the Namada WASM root dir
401404
let file = base_wasm_path.join(&full_name);

crates/tests/src/integration/setup.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,17 @@ pub fn initialize_genesis(
9494
};
9595

9696
// Create genesis chain release archive
97-
let release_archive_path =
98-
namada_apps_lib::client::utils::init_network(args::InitNetwork {
97+
let release_archive_path = namada_apps_lib::client::utils::init_network(
98+
global_args.clone(),
99+
args::InitNetwork {
99100
templates_path: genesis_path,
100101
wasm_checksums_path,
101102
chain_id_prefix,
102103
consensus_timeout_commit: Timeout::from_str("30s").unwrap(),
103104
archive_dir: None,
104105
genesis_time,
105-
});
106+
},
107+
);
106108

107109
// Decode and unpack the release archive
108110
let mut archive = {

0 commit comments

Comments
 (0)