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

Hide links to etherscan when no block explorer is specified for a custom network #5631

Closed
wbt opened this issue Oct 29, 2018 · 12 comments · Fixed by #10455
Closed

Hide links to etherscan when no block explorer is specified for a custom network #5631

wbt opened this issue Oct 29, 2018 · 12 comments · Fixed by #10455
Labels
area-customNetworks area-settings Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug ux-enhancement

Comments

@wbt
Copy link
Contributor

wbt commented Oct 29, 2018

Describe the bug
The transaction confirmation popup looks like this:
Confirmed Transaction

Clicking on it will open Etherscan to view the transaction on mainnet.

However, if the transaction was not on mainnet, Etherscan will (most likely) not find the transaction OR show information about a transaction other than the one the user initiated. It definitely will not show information about the transaction that was just confirmed on a private network.

To Reproduce
Steps to reproduce the behavior:

  1. Install MetaMask and create an account or log in to an existing install.
  2. Connect to a custom RPC running some dapp.
  3. Visit the dapp in a browser, trigger a transaction, and approve it.
  4. Wait until the transaction is mined.
  5. See the popup similar to screenshot above.
  6. Click on the popup.
  7. Etherscan will open in your default browser and say it can't find information about that transaction.

Expected behavior
A. "View on Etherscan" does not appear if the transaction was executed on a private network. In this case, the popup should not contain a link to Etherscan and Etherscan should not open if clicking on the popup.

B. If the transaction was executed on a large public testnet, it should open the Etherscan for that testnet (example links: Rinkeby, Ropsten, Kovan). I have not tested to see if this is already implemented.

C. In cases where there is an Etherscan view of the transaction (large public net), there is a line break before the word "View." (This might be a separate Issue.)

Browser details (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome 70.0.3538.77 (Official Build) (64-bit) (cohort: 70_77_Win)
  • MetaMask Version: 4.16.0
  • New / Beta UI
@bdresser bdresser changed the title Tx confirmation popup ignores network; gives useless Etherscan links Tx confirmation links to Mainnet Etherscan for Custom RPC networks Nov 5, 2018
@bdresser
Copy link
Contributor

bdresser commented Nov 5, 2018

We should disable Etherscan links for custom networks until we find a simple way to let people enter their own custom block explorers when using the custom RPC feature

@bdresser bdresser added the good first issue Good for newcomers label Nov 5, 2018
@wbt
Copy link
Contributor Author

wbt commented Nov 7, 2018

The way for people to enter custom block explorers is probably an optional field alongside the chainID, symbol, and nickname "Advanced options" for custom RPC. We could recognize some specific template placeholder to be replaced with the transaction ID, and append the transaction ID to the end of that URL if the placeholder is not found in a non-empty blockchain URL field value that is otherwise a reasonably well-formatted URL.

@wbt
Copy link
Contributor Author

wbt commented Nov 12, 2018

As a UI design point for feedback, are there any objections to changing "View on Etherscan" to "View on block explorer" more generally, when editing to address this issue?

@MicahZoltu
Copy link

Note: I use a custom network that points to mainnet for security (don't trust third party node providers and all that jazz). In whatever UI is created, there should be an option to mark a custom endpoint as mainnet.

Also, I have multiple custom endpoints, some of them point at private networks (no block explorer).

@wbt
Copy link
Contributor Author

wbt commented Feb 11, 2019

@MicahZoltu The Network Settings menu requested here would allow you to just replace the default provider for mainnet, and leave out block explorers for networks that don't have them.

@whymarrh whymarrh removed the good first issue Good for newcomers label Feb 12, 2019
@bdresser bdresser changed the title Tx confirmation links to Mainnet Etherscan for Custom RPC networks Hide links to etherscan when no block explorer is specified for a custom network May 23, 2019
@IvanRF
Copy link

IvanRF commented Nov 27, 2020

@bdresser this is an old issue, but the notification link is still pointing to https://etherscan.io/tx/${transaction_id} for a custom RPC network.

We should disable Etherscan links for custom networks until we find a simple way to let people enter their own custom block explorers when using the custom RPC feature

Since the option Block Explorer URL was already added, is it possible to use that URL on the notification links too?

@wbt
Copy link
Contributor Author

wbt commented Nov 30, 2020

It would also be nice to drop "View on etherscan" altogether when there is no block explorer for a custom network.

@Gudahtt Gudahtt added Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug labels Jan 6, 2021
@BboyAkers
Copy link
Contributor

BboyAkers commented Feb 14, 2021

@Gudahtt, I'll start working on this 🙂

@BboyAkers
Copy link
Contributor

These two PR's should fix this issue 🙂
MetaMask/etherscan-link#29
#10455

Gudahtt pushed a commit that referenced this issue Feb 17, 2021
…tom network (#10455)

Conditionally render view on Etherscan text if it's a custom network

Fixes: #5631
@IvanRF
Copy link

IvanRF commented Feb 19, 2021

@bdresser this is an old issue, but the notification link is still pointing to https://etherscan.io/tx/${transaction_id} for a custom RPC network.

Since the option Block Explorer URL was already added, is it possible to use that URL on the notification links too?

@BboyAkers thanks for the PR's! Since you made those fixes, I believe you will be able to fix what I mentioned 😃 .
I just saw there is an open issue too: #7864

In your last PR's the link was removed if the network is not a valid prefix for etherscan.io. However, Block Explorer URL can be used if it was set for the custom RPC network.

@BboyAkers
Copy link
Contributor

Hmmm interesting, I'll dig into this @IvanRF 🙂

@IvanRF
Copy link

IvanRF commented Feb 20, 2021

Hmmm interesting, I'll dig into this @IvanRF 🙂

@BboyAkers Excellent! thanks! 👏 👏 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-customNetworks area-settings Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug ux-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants