sapphire-paratime icon indicating copy to clipboard operation
sapphire-paratime copied to clipboard

sapphire-wagmi-v2: Patch dispatchEvent instead of addEventListener

Open lubej opened this issue 8 months ago • 2 comments

Alternative of https://github.com/oasisprotocol/sapphire-paratime/pull/565, by patching window.dispatchEvent instead of addEventListener.

lubej avatar Apr 25 '25 07:04 lubej

Deploy Preview for oasisprotocol-sapphire-paratime canceled.

Name Link
Latest commit f6ab9c43636d6928e0f9db0e5a99ce907fa9c5c6
Latest deploy log https://app.netlify.com/sites/oasisprotocol-sapphire-paratime/deploys/681b42cb0dbdf30008d233da

netlify[bot] avatar Apr 25 '25 07:04 netlify[bot]

These hacks seem tricky. Any ideas how to test it? Dappwright maybe?

Yes, there is a dappwright test in examples/wagmi-v2. And I did test 2 more ways, of trying to implement the same, but this one seemed the most straightforward. But unfortunately, the ideal way, wrapping of the provider based on the network - I was not able to quite figure it out.

Added 2 additional tests, so that every use-case is covered: https://github.com/oasisprotocol/sapphire-paratime/pull/579

lubej avatar Apr 26 '25 03:04 lubej