Skip to content

Commit

Permalink
feat: export named 'testnet' key in 'networks'
Browse files Browse the repository at this point in the history
  • Loading branch information
chadoh committed Sep 24, 2023
1 parent 519fc91 commit 74e3b90
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/crates/soroban-spec-typescript/src/boilerplate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use super::generate;

static PROJECT_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/src/project_template");

const NETWORK_PASSPHRASE_TESTNET: &str = "Test SDF Network ; September 2015";
const NETWORK_PASSPHRASE_FUTURENET: &str = "Test SDF Future Network ; October 2022";
const NETWORK_PASSPHRASE_STANDALONE: &str = "Standalone Network ; February 2017";

Expand Down Expand Up @@ -110,12 +111,11 @@ impl Project {
}

fn format_networks_object(contract_id: &str, network_passphrase: &str) -> String {
let network = if network_passphrase == NETWORK_PASSPHRASE_FUTURENET {
"futurenet"
} else if network_passphrase == NETWORK_PASSPHRASE_STANDALONE {
"standalone"
} else {
"unknown"
let network = match network_passphrase {
NETWORK_PASSPHRASE_TESTNET => "testnet",
NETWORK_PASSPHRASE_FUTURENET => "futurenet",
NETWORK_PASSPHRASE_STANDALONE => "standalone",
_ => "unknown",
};
format!(
r#"export const networks = {{
Expand Down

0 comments on commit 74e3b90

Please sign in to comment.