react-native-box icon indicating copy to clipboard operation
react-native-box copied to clipboard

Make create and import wallet work again

Open janayama opened this issue 7 years ago • 1 comments

This PR contains two things:

  1. It was using the package bip39 instead of react-native-bip39. This was doing that randombytes was not found since the bip39 use the randombytes from node and the react-native-bip39 uses the imported react-native-randombytes.

Because of this, the wallet was failing on the creation of a mnemonic with the error: secure random number generation not supported by this browser.

It worked when the debugger was connected, but it didn't without it.

  1. The action createWallet was not in the props of the component Create neither in the Import one. This is because the react-navigation does not propagate dispatching props for the components in the stack navigation. This connect the two components Create and Import to the createWallet dispatch action.

janayama avatar Jul 08 '18 09:07 janayama

Hi @DiscRiskandBisque I was checking this commit which actually you solved some problems by importing the package: react-native-randombytes

But there are two things that looks not right to me:

  1. We need to still use react-native-bip39: https://github.com/truffle-box/react-native-box/commit/bc84e9498751109c9e05bfd66faf1cb22b5022bc#diff-ac66dfad9141b336861c5a58db43dd22L5

  2. Screen props contains the properties but not the actions: https://github.com/truffle-box/react-native-box/commit/bc84e9498751109c9e05bfd66faf1cb22b5022bc#diff-ac66dfad9141b336861c5a58db43dd22R27

With this changes I am doing, the wallet will work again. What do you think?

janayama avatar Jul 09 '18 10:07 janayama