pioneer
pioneer copied to clipboard
π Inject metadata into signer
The latest updates on your projects. Learn more about Vercel for Git βοΈ
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
dao | β Ready (Inspect) | Visit Preview | May 19, 2023 8:11am |
pioneer-2 | β Ready (Inspect) | Visit Preview | May 19, 2023 8:11am |
pioneer-2-storybook | β Ready (Inspect) | Visit Preview | May 19, 2023 8:11am |
Context
I've been struggling fixing the tests on this PR. The tests pass on my laptop but they kept on failing with Cannot read property 'createEvent' of null
This started happening after the changes from the Ephesus release got merged here.
I think that the issue comes from 2 instances of @polkadot/wasm-crypto
running in Pioneer and the in the injectweb3-connect
package. The logs show a bunch of warning about this and other polkadot packages (after removing the --silent
from the yarn ci-test
command).
Eventually the log shows: FATAL: Unable to initialize @polkadot/wasm-crypto:: WebAssembly.instantiate(): Out of memory: wasm memory
:
Finally the CI fails shortly after with Cannot read property 'createEvent' of null
.
Here is an example of this happening. BTW on this link and screenshots :point_up_2: I matched the dependencies of injectweb3-connect
with Pioneer's but it didn't help.
In the end I just mocked injectweb3-connect
which fixed the tests and IMO that's good enough for this PR.
Questions
However in the long run Pioneer should avoid running duplicates of memory intensive polkadot libs. So @WRadoslaw I was wondering:
- Do you agree with my conclusions ? or if I might have missed something ?
- Did you end up using
injectweb3-connect
on Atlas too ? Do you think it's worth maintaining this package ? -
@talismn/connect-wallets
seems to avoid this problem by keeping@polkadot/*
in dev dependencies, and declaring them as peer dependencies for production. But for this to work the Webpack target should change, maybe "node" could work (to not bundle thenode_modules
) or maybe callingtsc
could be enough. WDYT ?
Tested on https://dao-git-feature-inject-metadata-into-signer-joystream.vercel.app/ Mainnet
@thesan All is works as expected. I am not encountered any problems with updating metadata
Chrome
β Polkadot(successfully updated metadata/wallet is ok) β SubWallet(successfully updated metadata/wallet is ok) β Talisman(metadata up to date/app donβt ask to update)
Brave
β Polkadot(successfully updated metadata/wallet is ok) β SubWallet(successfully updated metadata/wallet is ok) β Talisman(successfully updated metadata/wallet is ok)
Firefox
β Polkadot(successfully updated metadata/wallet is ok) β SubWallet(successfully updated metadata/wallet is ok) β Talisman(successfully updated metadata/wallet is ok)
Great work @ivanturlakov :raised_hands:
~~I wasn't expecting it to work with Talisman everywhere. I was just hopping it would not break the wallet.~~ Oh right! it doesn't update on Chrome because it's already up to date...