multiversx / mx-sdk-py-cli

Python Command Line Tools and SDK for interacting with the MultiversX blockchain and dApps.
Other
34 stars 36 forks source link

mxpy wallet convert: extra validation for converting keystore files #350

Closed andreibancioiu closed 9 months ago

andreibancioiu commented 10 months ago

For example, currently, there is no validation error when trying to do the following (incorrect usage):

mxpy wallet convert --infile=keystoreWithKindMnemonic.json --in-format=keystore-secret-key ...

Most probably, the change (or at least a part of it) should be implemented in sdk-wallet - we have to guard that the kind field is indeed missing here:

https://github.com/multiversx/mx-sdk-py-wallet/blob/main/multiversx_sdk_wallet/user_wallet.py#L57

popenta commented 9 months ago

The change has been implemented in py-wallet in this PR. If the file contains the kind field, an extra check is made to make sure the type matches.