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

feat: point to beta-4 faucet and block explorer by default #134

Merged
merged 1 commit into from
Aug 27, 2023
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
7 changes: 6 additions & 1 deletion src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,11 @@ pub(crate) fn verify_address_and_update_cache(
pub(crate) fn print_balance_empty(node_url: &Url) {
let beta_2_url = crate::network::BETA_2.parse::<Url>().unwrap();
let beta_3_url = crate::network::BETA_3.parse::<Url>().unwrap();
let beta_4_url = crate::network::BETA_4.parse::<Url>().unwrap();
let faucet_url = match node_url.host_str() {
host if host == beta_2_url.host_str() => crate::network::BETA_2_FAUCET,
host if host == beta_3_url.host_str() => crate::network::BETA_3_FAUCET,
host if host == beta_4_url.host_str() => crate::network::BETA_4_FAUCET,
_ => return println!(" Account empty."),
};
println!(
Expand Down Expand Up @@ -488,9 +490,12 @@ pub(crate) async fn transfer_cli(
.await?;

let block_explorer_url = match transfer.node_url.host_str() {
host if host == crate::network::BETA_3.parse::<Url>().unwrap().host_str() => {
host if host == crate::network::BETA_4.parse::<Url>().unwrap().host_str() => {
crate::explorer::DEFAULT
}
host if host == crate::network::BETA_3.parse::<Url>().unwrap().host_str() => {
crate::explorer::BETA_3
}
host if host == crate::network::BETA_2.parse::<Url>().unwrap().host_str() => {
crate::explorer::BETA_2
}
Expand Down
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ pub mod utils;

/// The default network used in the case that none is specified.
pub mod network {
pub const DEFAULT: &str = BETA_3;
pub const DEFAULT: &str = BETA_4;
pub const BETA_2: &str = "https://node-beta-2.fuel.network";
pub const BETA_2_FAUCET: &str = "https://faucet-beta-2.fuel.network";
pub const BETA_3: &str = "https://beta-3.fuel.network/";
pub const BETA_3_FAUCET: &str = "https://faucet-beta-3.fuel.network/";
pub const BETA_4: &str = "https://beta-4.fuel.network/";
pub const BETA_4_FAUCET: &str = "https://faucet-beta-4.fuel.network/";
}

/// Contains definitions of URLs to the block explorer for each network.
pub mod explorer {
pub const DEFAULT: &str = BETA_3;
pub const DEFAULT: &str = BETA_4;
pub const BETA_2: &str = "https://fuellabs.github.io/block-explorer-v2/beta-2";
pub const BETA_3: &str = "https://fuellabs.github.io/block-explorer-v2/beta-3";
pub const BETA_4: &str = "https://fuellabs.github.io/block-explorer-v2/beta-4";
}
Loading