react-native-box
react-native-box copied to clipboard
Make create and import wallet work again
This PR contains two things:
- It was using the package
bip39instead ofreact-native-bip39. This was doing thatrandombyteswas not found since thebip39use therandombytesfrom node and thereact-native-bip39uses the importedreact-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.
- The action
createWalletwas not in the props of the componentCreateneither in theImportone. This is because the react-navigation does not propagate dispatching props for the components in the stack navigation. This connect the two componentsCreateandImportto thecreateWalletdispatch action.
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:
-
We need to still use
react-native-bip39: https://github.com/truffle-box/react-native-box/commit/bc84e9498751109c9e05bfd66faf1cb22b5022bc#diff-ac66dfad9141b336861c5a58db43dd22L5 -
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?