edr
edr copied to clipboard
Investigate how to make JSON serde errors user-friendly
Several Hardhat tests have been deactivated as we cannot match the helpful error messages in Hardhat with our current approach. The codebase contains TODOs with a link to this issue for those instances.
Definition of Done Create a plan to provide more user-friendly error messages for JSON parsing failures and create associated tasks
https://www.notion.so/nomicfoundation/Meeting-hardhat-s-provider-error-expectations-9d0c44a5e18a424c8ab0b0c7a849e778
https://github.com/NomicFoundation/hardhat/issues/6660 reported another instance that should be improved:
const { provider } = await hre.network.connect();
let blockNumber = 0;
// throws error
await provider.request({ method: 'eth_getBalance', params: ['0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', blockNumber]});
throws with an error:
ProviderError: Method eth_getBalance is not supported
As none of the enum MethodInvocation variants matches the provided input, we overzealously assume that the method didn't exist. It would be more helpful if EDR reported invalid parameters as the reason.