Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

fix: source code downloading and update api url on metis network #2693

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

brotherlymite
Copy link
Contributor

Motivation

Currently when we run cast etherscan-source --chain 1088 0x6c3bD2D5885D9e8a9B48c403EEb7A25195b7CCc1 to download source code on metis network, it throws an error data did not match any variant of untagged enum ResponseData which is because the response from the api https://andromeda-explorer.metis.io/api is not 100% compatible with the etherscan, so when it tries to deserialize it here during the sanity check the error is thrown.

Solution

Metis has a new updated explorer and api which is more compatible with etherscan. The api response for downloading the source code on the new api is in-line with the etherscan one and should fix the issue.
Also as per the Metis team, the old api url and explorer is soon gonna be deprecated so I think it is a good idea to update it.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@@ -516,7 +516,7 @@ impl Chain {
}

Metis => {
("https://andromeda-explorer.metis.io/api", "https://andromeda-explorer.metis.io/")
("https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan/api", "https://explorer.metis.io/")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this url looks oddly long,
is this documented somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattsse
Copy link
Collaborator

mattsse commented Dec 1, 2023

do you have a sample response that fails deserialization?

@brotherlymite
Copy link
Contributor Author

do you have a sample response that fails deserialization?

You can query this api to get the response

@mattsse mattsse merged commit f0e5b19 into gakonst:master Dec 1, 2023
17 of 19 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants