xchainjs-lib
xchainjs-lib copied to clipboard
Address derived from mnemonic in constructor
Hello xcommunity!
As my colleague Nikita already pointed out in this issue the loading times for wallet initialization are quite high. This issue has been closed but the problem has not been resolved.
The constructor calls setPhrase
, which calls getAddress
at the end of the function. This return value is ignored, while being responsible for the computational intense key derivation from the mnemonic. By removing getAddress
in setPhrase
you would really do us and probably many others a favor!
See this function: https://github.com/xchainjs/xchainjs-lib/blob/aa9e4eba4423ec249a3f1d8757960f9a07c971b2/packages/xchain-cosmos/src/client.ts#L154
Edit: The link is only an example. This behaviour should not be in any of the packages.
+1
+1
+1
+1
+1
+1
+1
+1
+1
@DollyVolley Good point + thanks for bringing this issue up again! We already have a bunch of +1 comments here, but honestly a PR would be more helpful here guys ;) Pls note: xchain-* is a community driven project and anybody is welcome to create a PR. This issue is a good one for doing this. Let's do it together :muscle:
the fix is included in the upgrade to cosmos-client 0.42.14