You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't found any solution for this problem using hardhat. So, if there is actually already a solution for this, I'd be delighted to get to know it.
Problem
I'm using mainly custom errors in my contracts and many of them are used in multiple places in a contract. When I'm testing the contract for these errors, I need to write down the custom error as a string every time. I can define constant values for each custom error that defines that string value, but it's not so nice to have to do that for each custom error.
So, for the following error:
error NoAuthorization();
I need to use the string "NoAuthorization" whenever I test this error occurrence:
I'd like to have access to a selector or some sort of reference of the custom errors of my contracts, so that I don't need to use a string value for them. This could look something similar to the following:
Describe the feature
Problem
I'm using mainly custom errors in my contracts and many of them are used in multiple places in a contract. When I'm testing the contract for these errors, I need to write down the custom error as a string every time. I can define constant values for each custom error that defines that string value, but it's not so nice to have to do that for each custom error.
So, for the following error:
error NoAuthorization();
I need to use the string "NoAuthorization" whenever I test this error occurrence:
Feature Request
I'd like to have access to a selector or some sort of reference of the custom errors of my contracts, so that I don't need to use a string value for them. This could look something similar to the following:
Related to #3486
Search terms
Custom Error
The text was updated successfully, but these errors were encountered: