Skip to content

Commit

Permalink
add explorer prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
0xh3rman committed Jan 16, 2024
1 parent 193ece4 commit 2656e54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions gemstone/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub async fn say_after(ms: u64, who: String) -> String {
}

#[uniffi::export]
pub fn get_name_by_host(host: String) -> String {
pub fn get_explorer_name_by_host(host: String) -> String {
let name = match host.as_str() {
"etherscan.io" => "Etherscan",
"tonscan.org" => "TONScan",
Expand All @@ -26,11 +26,9 @@ pub fn get_name_by_host(host: String) -> String {
"blockchair.com" => "Blockchair",
"tronscan.org" => "TRONSCAN",
"basescan.org" => "BaseScan",
"explorer.sui.io" => "Sui Explorer",
"suiexplorer.com" => "Sui Explorer",
"explorer.sui.io" | "suiexplorer.com" => "Sui Explorer",
"explorer.aptoslabs.com" => "Aptos Explorer",
"mintscan.io" => "MintScan",
"www.mintscan.io" => "MintScan",
"mintscan.io" | "www.mintscan.io" => "MintScan",
_ => "",
};
name.into()
Expand Down
4 changes: 2 additions & 2 deletions gemstone/tests/ios/GemTest/GemTestTests/GemTestTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class GemTestTests: XCTestCase {
}

func testGetExplorerName() {
XCTAssertEqual(Gemstone.getNameByHost(host: "etherscan.io"), "Etherscan")
XCTAssertEqual(Gemstone.getNameByHost(host: "www.mintscan.io"), "MintScan")
XCTAssertEqual(Gemstone.getExplorerNameByHost(host: "etherscan.io"), "Etherscan")
XCTAssertEqual(Gemstone.getExplorerNameByHost(host: "www.mintscan.io"), "MintScan")
}
}

0 comments on commit 2656e54

Please sign in to comment.