oasisprotocol / sapphire-paratime

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

Fixes some minor issues to make it work with Ethers v5 & v6, #261

Closed CedarMist closed 7 months ago

CedarMist commented 7 months ago

and reduces bundle size by adding ethers as a peer dependency

js-sha512 is replaced with @noble/hashes (used by Ethers v6)

Both ethers & noble hashes are added as peer dependencies.

Some minor fixes around detecting the chain ID and whether it's ethers v6. If direct type comparisons are done (e.g. instanceof AbstractSigner and the ethers version isn't identical it will fail, so ended up using reflection to roughly determine if it's ethers v5 or ethers v6)