xchainjs-lib icon indicating copy to clipboard operation
xchainjs-lib copied to clipboard

Address derived from mnemonic in constructor

Open DollyVolley opened this issue 3 years ago • 11 comments

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.

DollyVolley avatar Aug 31 '21 13:08 DollyVolley

+1

mr-rooftop avatar Aug 31 '21 14:08 mr-rooftop

+1

gebes avatar Aug 31 '21 15:08 gebes

+1

zgast avatar Aug 31 '21 15:08 zgast

+1

paul1tsch avatar Aug 31 '21 16:08 paul1tsch

+1

KesSaft avatar Aug 31 '21 16:08 KesSaft

+1

RealMuffinTime avatar Aug 31 '21 16:08 RealMuffinTime

+1

ImMaci avatar Aug 31 '21 16:08 ImMaci

+1

floriandulzky avatar Aug 31 '21 17:08 floriandulzky

+1

JP1-dev avatar Aug 31 '21 17:08 JP1-dev

@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:

veado avatar Sep 01 '21 07:09 veado

the fix is included in the upgrade to cosmos-client 0.42.14

mikewyszinski avatar Sep 30 '21 04:09 mikewyszinski