naddison36/tx2uml

Make EtherscanClient more resilient

doncesarts opened this issue · 1 comments

Sometimes etherscan might reach the max rate limit and therefore fail the complete tx sequence diagram.

Locally I avoid this by changing the following lines of code
https://github.com/naddison36/tx2uml/blob/master/lib/clients/EtherscanClient.js#L108

            // throw new Error(`Failed to get contract details for contract ${contractAddress} from Etherscan using url ${this.url}`, { cause: err });
               // Sleep for a 1 second if no contract was returned to avoid Etherscan rate limits
               await (0, time_1.sleep)(1000);
               return {
                   address: contractAddress,
                   noContract: false,
                   contractName: null,
               };  

I am happy to contribute with this issue, but not sure if this change is the correct approach or a flag should be provided, or just the default behavior should be to fallback to at least being able to finish the diagram

what do you think @naddison36 ?