enzoferey / ethers-error-parser

Parse Ethers.js errors with ease ๐Ÿ’…๐Ÿป
MIT License
66 stars 8 forks source link

feat: support contract not deployed #43

Open challet opened 1 year ago

challet commented 1 year ago

Is your pull request closing an issue?

No

Please explain the main changes of your pull request

ether.js Contract.deployed function can throw an error about the contract not being deployed.

This adds a new error type CONTRACT_NOT_DEPLOYED for this case with the address having been requested as a context.

Checklist

codecov-commenter commented 1 year ago

Codecov Report

Merging #43 (94c0d52) into main (d4e452b) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #43   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          666       693   +27     
  Branches        79        84    +5     
=========================================
+ Hits           666       693   +27     
Impacted Files Coverage ฮ”
lib/__tests__/getParsedEthersError.test.ts 100.00% <100.00%> (รธ)
lib/constants.ts 100.00% <100.00%> (รธ)
lib/utils/getTopLevelKnownError.ts 100.00% <100.00%> (รธ)

:mega: Weโ€™re building smart automated test selection to slash your CI/CD build times. Learn more

enzoferey commented 1 year ago

Hey @challet ! Thanks for the PR ๐Ÿ™๐Ÿป

I'm a bit busy these day, but I will look at it as soon as possible ๐Ÿ‘๐Ÿป

challet commented 1 year ago

Hi @enzoferey, you're welcome. When you have time, I would be glad to have your opinion on it : the error format I'm testing comes from a Ganache backend and I'm not totally confident it would work everywhere.