Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): remove circular import in store.ts & MnemonicWallet (#279)
The circular import: `src/wallets/mnemonic` imports `src/store`, which imports a few types from `src/wallets`. The `src/wallets/mnemonic` is still loaded when `src/store` imports `src/wallet` despite nothing from `src/wallets/mnemonic` being used. In short, `src/wallets/mnemonic` imports `src/store`, which indirectly imports `src/wallets/mnemonic`. This circular import caused an odd issue where the persisted mnemonic had "undefined_mnemonic" as the key in localStorage because `LOCAL_STORAGE_KEY` constant (defined in `src/store.ts` before building the package) was used before it was defined in the `dist/index.js` build output file. The bundler got confused by the circular import and put the modules in the resulting `dist/index.js` in the wrong order.
- Loading branch information