oasisprotocol / sapphire-paratime

Oasis Sapphire - the confidential EVM-compatible ParaTime for the Oasis Network
https://oasisprotocol.org/sapphire
Apache License 2.0
37 stars 27 forks source link

clients/js: added regression tests for ethers v5 & ethers v6 #267

Closed CedarMist closed 9 months ago

CedarMist commented 9 months ago

Closes: #169


While testing I encountered another problem: custom reverts are broken with Ethers v5. This is due to type confusion in Ethers v5 by then trying to work-around people avoiding type confusion in JSON-RPC endpoints. See: https://github.com/ethers-io/ethers.js/blob/ec1b9583039a14a0e0fa15d0a2a6082a2f41cf5b/packages/providers/src.ts/json-rpc-provider.ts#L61

Custom reverts never worked with Ethers v5, but worked when using Hardhat with Ethers v5... Now we have tests for ethers v5 & ethers 6.

Note that reversion data returned by oasis-web3-gateway isn't encrypted. These errors are successfully caught by Ethers v6 and are not attempted to be decrypted by the sapphire wrapper. So the recommendation is to upgrade to Ethers v6.