File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -327,7 +327,7 @@ impl NetworkRunnable for Cmd {
327327 data:: write ( get_txn_resp. clone ( ) . try_into ( ) ?, & network. rpc_uri ( ) ?) ?;
328328 }
329329
330- if let Some ( url) = utils:: explorer_url_for_contract ( & network, & contract_id) {
330+ if let Some ( url) = utils:: lab_url_for_contract ( & network, & contract_id) {
331331 print. linkln ( url) ;
332332 }
333333
Original file line number Diff line number Diff line change @@ -41,19 +41,24 @@ static EXPLORERS: phf::Map<&'static str, &'static str> = phf_map! {
4141 "Public Global Stellar Network ; September 2015" => "https://stellar.expert/explorer/public" ,
4242} ;
4343
44+ static LAB_CONTRACT_URLS : phf:: Map < & ' static str , & ' static str > = phf_map ! {
45+ "Test SDF Network ; September 2015" => "https://lab.stellar.org/r/testnet/contract/{contract_id}" ,
46+ "Public Global Stellar Network ; September 2015" => "https://lab.stellar.org/r/mainnet/contract/{contract_id}" ,
47+ } ;
48+
4449pub fn explorer_url_for_transaction ( network : & Network , tx_hash : & str ) -> Option < String > {
4550 EXPLORERS
4651 . get ( & network. network_passphrase )
4752 . map ( |base_url| format ! ( "{base_url}/tx/{tx_hash}" ) )
4853}
4954
50- pub fn explorer_url_for_contract (
55+ pub fn lab_url_for_contract (
5156 network : & Network ,
5257 contract_id : & stellar_strkey:: Contract ,
5358) -> Option < String > {
54- EXPLORERS
59+ LAB_CONTRACT_URLS
5560 . get ( & network. network_passphrase )
56- . map ( |base_url| format ! ( "{base_url}/contract/{ contract_id}" ) )
61+ . map ( |base_url| base_url . replace ( "{contract_id}" , & contract_id . to_string ( ) ) )
5762}
5863
5964/// # Errors
You can’t perform that action at this time.
0 commit comments